Answers:
另一个选择是xsel
程序:
By default, this program outputs the selection without modification if both standard input and standard output are terminals (ttys). Other‐ wise, the current selection is output if standard output is not a ter‐ minal (tty), and the selection is set from standard input if standard input is not a terminal (tty). If any input or output options are given then the program behaves only in the requested mode.
因此,只需将某些内容复制到剪贴板,然后运行xsel
即可将其打印到终端。您可以通读man xsel
更多高级选项,例如应使用哪个剪贴板等。
alias pbcopy='xsel --clipboard --input'; alias pbpaste='xsel --clipboard --output'
我选择了与MacOS命令匹配的名称。