jump to navigation

Command line copying with xsel February 11, 2009

Posted by maxmil in : Debian,XWindows , add a comment

Useful for copying stuff from the command line directly into the clipboard (context menu > copy, equivalent to Ctrl+C) in order to be pasted in other XWindow apps.

Example

$ cat some-file | xsel -b

There is a similar command xclip that does more or less the same stuff except i don’t think it only copies to the primary clipboard (ie updates the selected text that can be pasted with the middle mouse button).

Both can be installed on Debian with apt-get xsel xclip.