xclip is a tool to copy whole terminal outputs as well as from text files, to be pasted elsewhere. In short, sending text outputs to the clipboard. I needed this because, sometimes, copying outputs from terminal can be a hassle. One for the fact that clicking and dragging can be a pain with all the text going on, and also because, ctrl + shift + c is used for copying rather than ctrl + c, which is to cancel the current process running in the terminal, which can end up really bad sometimes.
Anyways, listed below are some good uses of xclip.
ls -a | xclipor any command that outputs text on the terminal like cat, would send the text output to the clipboard.
xclip -owould output the text on the clipboard. The last text that was copied
xclip path/to/textfilewould send the contents of the file to clipboard for pasting it elsewhere.
- You could also send the contents of the clipboard to a file by saying
xclip -o > somefile.txt. This is ofcourse obvious for any command outputting text.