[shell]输出内容到剪切板

commandline和GUI下的clipboard的交互
Mac下
echo $PATH | pbcopy,copy to clipboard
echo "$(pbpaste -Prefer text)",copy from clipboard

Linux下,首先需要安装xsel
echo $PATH | xsel --clipboard,copy to clipboard
echo "$(xsel --output --clipboard)",copy from clipboard

Windows下,clip是需要另外安装的外部程序
set %path% | clip

Cygwin下
echo $PATH | putclip,copy to clipboard
echo "$(getclip)",copy from clipboard

你可能感兴趣的:(shell)