Copy to or paste from the clipboard (X11-named alias).
Synopsis
xclip [-i|-o]
Description
Copies stdin to the clipboard, or prints the clipboard to stdout, via the browser's Clipboard API. Auto-detects direction based on whether stdin is present, unless -i/-o is given.
Options
-i Force copy mode (read from stdin).
-o Force paste mode (write to stdout).
Examples
$ echo hello | xclip
Copy 'hello' to the clipboard.
$ xclip -o > file.txt
Paste the clipboard into a file.
Notes
Equivalent to pbcopy/pbpaste, named for familiarity on Linux. xsel behaves identically.
See Also
pbcopy, pbpaste, xsel