http://justcoding.iteye.com/blog/1829963linux
1. Windows下ubuntu
使用系統自帶的clip
命令。
# 位於C:\Windows\system32\clip.exe
。bash
示例:app
2. Ubuntu下ssh
ubuntu下的用戶能夠只用apt-get來安裝:編輯器
xclip能夠將內容輸出到‘X’的剪切板中,好比:oop
執行這個命令後你就能夠用鼠標中鍵來在X程序中將內容粘貼出來。可是更多的時候,咱們須要不單單把內容輸出到‘X’的剪切板中,而是但願能夠在 GUI程序 中用ctrl + v也能夠粘貼(好比,輸出到gnome的剪切板中),下面這段命令就可讓你將內容輸出到gnome的剪切板中:this
再在一個GUI程序中按下ctrl + v,看下是否是粘貼上去了呢?順着這個命令,我也從新寫了一下ifconfig,讓它在執行後輸入內容到終端的同時,也將ip地址輸出到剪切板中,由於一般狀況下,查看ifconfig就是爲了獲取機器的ip地址:spa
或者.net
此時你就能夠在網頁等編輯框CTRL+V了。
項目主頁:http://sourceforge.net/projects/xclip/
命令man page: http://linux.die.net/man/1/xclip
-i, -in read text into X selection from standard input or files (default) -o, -out prints the selection to standard out (generally for piping to a file or program) -f, -filter when xclip is invoked in the in mode with output level set to silent (the defaults), the filter option will cause xclip to print the text piped to standard in back to standard out unmodified -l, -loops number of X selection requests (pastes into X applications) to wait for before exiting, with a value of 0 (default) causing xclip to wait for an unlimited number of requests until another application (possibly another invocation of xclip) takes ownership of the selection -d, -display X display to use (e.g. "localhost:0"), xclip defaults to the value in $ DISPLAY if this option is omitted
使用xsel
命令。
示例:
4. Mac下
使用pbcopy
命令。 # 對應有個pbpaste
命令。
示例:
命令的結果輸出時,若是給複製命令(即上面提到的命令clip、xsel、pbcopy)那麼命令輸出就看不到了。若是你想先看到命令的輸出,能夠下面這麼作。
tee
命令把輸出輸到控制檯和一個文件中。命令執行完成後,再把輸出的內容放到剪貼板中。
使用下面的命令: