Copy to or paste from the clipboard (X11-named alias).

Synopsis

xsel [-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 | xsel

Copy 'hello' to the clipboard.

$ xsel -o > file.txt

Paste the clipboard into a file.

Notes

Equivalent to pbcopy/pbpaste and to xclip; all three names point at the same clipboard implementation.

See Also

pbcopy, pbpaste, xclip