xclip – some good uses

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.

  1. ls -a | xclip or any command that outputs text on the terminal like cat, would send the text output to the clipboard.
  2. xclip -o would output the text on the clipboard. The last text that was copied
  3. xclip path/to/textfile would send the contents of the file to clipboard for pasting it elsewhere.
  4. 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.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s