uclip - command-line interface to the X clipboard (aka "selections")
uclip [OPTION]... [FILE]...
uclip is a command-line interface to the X clipboard. It either copies text,
from FILE or from stdin, to the X clipboard, or prints the X clipboard to std-
out. uclip supports Unicode and is locale-aware (in contrast to other similar
utilities). uclip was written using Qt.
You can download uclip from:
If no OPTION is specified, uclip prints the X clipboard to stdout.
-f,-o Prints the X clipboard to stdout. This is the default action, unless
FILE, '-a', or '-r', are given.
-t,-i Copies the text from FILE, or from stdin if no FILE is specified, to the
X clipboard. Actually, this switch is only needed when reading from
stdin, because it is implied when a FILE is given.
uclip forks and waits in the background serving requests till some other
application (or another invocation of uclip) takes over the X selection.
-u Do input/output in UTF-8, regardless of the locale. If '-u' is not speci-
fied, uclip does input/output in the locale's encoding.
-c Use XA_CLIPBOARD (the default). This usually corresponds to the text you
explicitly copy to the clipboard using your application's "Copy" command.
-s Use XA_PRIMARY instead of XA_CLIPBOARD. This usually corresponds to the
text highlighted with the mouse.
-z Clear the clipboard.
-a Append to the clipboard instead of replacing it.
-r Replace the contents of the clipbord. This is the default and is the com-
plement of '-a'.
Assuming you double clicked the URL address in your browser, this down-
loads the document.
Print a fortune cookie and copy it to the X selection so that later you
can insert it into you mail message using the middle mouse button ('-' is
a synonym for stdin, so it's not necessary to specify '-t').
Copy the contents of all txt files to the clipboard.
You can now exit the application without worrying about losing the selec-
Open a new window with the definition of the highlighted word.
Type this in VI to paste the clipboard into the buffer.
The '-display' option is not supported. Do "DISPLAY=... uclip" instead.
uclip doesn't warn you when it fails to convert between encodings. For example,
when you do "uclip FILE" in a UTF-8 locale, and FILE is encoded in ISO-8859-8,
uclip just writes gibberish to the clipboard.
How to copy/paste, or get/set, the X11 selection, X11 clipboard, from shell
script, scripts. standard input, output.