Linux Clipboard xsel, wl-clipboard
wl-clipboard on Wayland
Section titled “wl-clipboard on Wayland”# Copy a simple text message:$ wl-copy Hello world!
# Copy the list of files in ~/Downloads:$ ls ~/Downloads | wl-copy
# Copy an image:$ wl-copy < ~/Pictures/photo.png
# Copy the previous command:$ wl-copy "!!"
# Paste to a file:$ wl-paste > clipboard.txt
# Sort clipboard contents:$ wl-paste | sort | wl-copy
# Upload clipboard contents to a pastebin on each change:$ wl-paste --watch nc paste.example.org 5555xsel on X Windows
Section titled “xsel on X Windows”# Paste output of working directory to X clipboardpwd | xsel --clipboardecho "hello" | xsel -b# -b or --clipboard - operate on clipboard selection
# Copy clipboard contents to a filexsel -ob >input.md# -o write selection to standard output# -b operate on clipboard selection
# Copy file contents to clipboardxsel --clipboard <input.md