Mac
Mac自带工具pbcopy
与pbpaste
:
复制
pbcopy < file.txt
cat file.txt | pycopy
粘贴
pbpaste > file.txt
Ubuntu
Ubuntu需要安装xclip
工具:
sudo apt-get install xclip
复制(到 gnome 的剪贴板)
xclip -selection < file.txt
cat file.txt | xclip -selection
粘贴
xclip > file.txt
Linux
Linux自带xsel
工具:
复制(到 gnome 的剪贴板)
xsel < file.txt
cat file.txt | xsel
粘贴
xsel > file.txt
Windows
Windows系统自带clip
工具:
复制
clip < file.txt
echo file.txt | clip
粘贴
clip > file.txt