How To Install Xclip?
xclip
Maintainer: Alessandro Ghedini
Email: [email protected] .
Website: https://github.com/astrand/xclip
Section: x11
Install xclip
-
Debian
apt-get install xclipClick to copy -
Ubuntu
apt-get install xclipClick to copy -
Alpine OS
apk add xclipClick to copy -
Arch Linux
pacman -S xclipClick to copy -
Kali Linux
apt-get install xclipClick to copy -
Fedora
dnf install xclipClick to copy -
Raspbian
apt-get install xclipClick to copy -
macOS
brew install xclipClick to copy
X11 clipboard manipulation tool, similar to `xsel`. Handles the X primary and secondary selections, plus the system clipboard (`Ctrl + C`/`Ctrl + V`).
How to use xclip?
Below are few example commands for xclip that you can use in the terminal.
Copy the output from a command to the X11 primary selection area (clipboard):echo 123 | xclipClick to copyCopy the output from a command to a given X11 selection area:echo 123 | xclip -selection primary|secondary|clipboardClick to copyCopy the contents of a file to the system clipboard, using short notation:echo 123 | xclip -sel clipClick to copyCopy the contents of a file into the system clipboard:xclip -sel clip input_file.txtClick to copyPaste the contents of the X11 primary selection area to the console:xclip -oClick to copyPaste the contents of the system clipboard to the console:xclip -o -sel clipClick to copyPaste the contents of the system clipboard into a file:xclip -o -sel clip > output_file.txtClick to copy
Installing xclip command is simple. just copy one of the above commands for your operating system and paste it into terminal. This command is available for Debian, Ubuntu, Alpine, Arch, Kali, Fedora, Raspbian and macOS operating systems. Once you run the command it will install the latest version of xclip 2026 package in your OS.




