XCLIP(1) | General Commands Manual | XCLIP(1) |
xclip - command line interface to X selections (clipboard)
xclip [OPTION] [FILE]...
Reads from standard in, or from one or more files, and makes the data available as an X selection for pasting into X applications. Prints current X selection to standard out.
xclip reads text from standard in or files and makes it available to other X applications for pasting as an X selection (traditionally with the middle mouse button). It reads from all files specified, or from standard in if no files are specified. xclip can also print the contents of a selection to standard out with the -o option.
xclip was designed to allow tighter integration of X applications and command line programs. The default action is to silently wait in the background for X selection requests (pastes) until another X application places data in the clipboard, at which point xclip exits silently. You can use the -verbose option to see if and when xclip actually receives selection requests from other X applications.
Options can be abbreviated as long as they remain unambiguous. For example, it is possible to use -d or -disp instead of -display. However, -v couldn't be used because it is ambiguous (it could be short for -verbose or -version), so it would be interpreted as a filename.
Note that only the first character of the selection specified with the -selection option is important. This means that "p", "sec" and "clip" would have the same effect as using "primary", "secondary" or "clipboard" respectively.
I hate man pages without examples!
uptime | xclip
Put your uptime in the X selection. Then middle click in an X application to paste.
xclip -loops 10 -verbose /etc/motd
Exit after /etc/motd (message of the day) has been pasted 10 times. Show how many selection requests (pastes) have been processed.
xclip -o > helloworld.c
Put the contents of the selection into a file.
xclip -t text/html index.html
Middle click in an X application supporting HTML to paste the contents of the given file as HTML.
Please report any bugs, problems, queries, experiences, etc. directly to the author.
Kim Saunders <kims@debian.org> Peter Åstrand <astrand@lysator.liu.se>