xclip
A command-line interface to the X11 clipboard.
xclip is a command-line interface to the X11 clipboard. It reads from stdin and writes to one of the X11 selections (primary, secondary, clipboard), and vice versa. It is a key piece of glue for terminal-based workflows that need to interact with the desktop clipboard.
xclip predates Wayland and works only on X11 sessions. The modern Wayland equivalent is wl-clipboard (wl-copy / wl-paste), which most distributions install alongside xclip on Wayland- default desktops so that older scripts continue to work through Xwayland.
Kim Saunders wrote xclip in 2001 and the project has been remarkably stable since. Most Linux dotfile templates pipe through xclip for "yank this to the clipboard" operations in shell scripts and editor configurations. The codebase is small and rarely changes — a quiet utility doing one job well.
Install
Debian/Ubuntu: sudo apt install xclip Fedora/RHEL: sudo dnf install xclip Arch: sudo pacman -S xclip
Authors
- Kim Saunders (creator)