LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

xsel

Manipulate X11 clipboard selections

TLDR

Copy to clipboard
$ echo 123 | xsel -ib
copy
Copy file to clipboard
$ cat [path/to/file] | xsel -ib
copy
Output clipboard
$ xsel -ob
copy
Output to file
$ xsel -ob > [path/to/file]
copy
Clear clipboard
$ xsel -cb
copy
Output primary selection
$ xsel -op
copy

SYNOPSIS

xsel [OPTIONS]

DESCRIPTION

xsel manipulates X11 clipboard and selection buffers. It can read, write, clear, and exchange content between primary selection, secondary selection, and clipboard.Similar to xclip but with different syntax and additional features.

PARAMETERS

-i, --input

Read from stdin
-o, --output
Write to stdout
-c, --clear
Clear selection
-b, --clipboard
Use clipboard selection (Ctrl+C/V)
-p, --primary
Use primary selection (middle click)
-s, --secondary
Use secondary selection
-a, --append
Append to selection

INSTALL

sudo apt install xsel
copy
sudo dnf install xsel
copy
sudo pacman -S xsel
copy
sudo apk add xsel
copy
sudo zypper install xsel
copy
brew install xsel
copy
nix profile install nixpkgs#xsel
copy

CAVEATS

X11 only. Content may be lost when X server restarts. Use wl-copy/wl-paste for Wayland.

SEE ALSO

xclip(1), wl-copy(1), wl-paste(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid