Forrest logo
tool overview
On this page you find all important commands for the CLI tool xsel. If the command you are looking for is missing please ask our AI.

xsel

xsel is a command line tool for manipulating the X Selection. It allows you to access and modify the contents of the X clipboard from the command line. The X Selection is a common area of temporary storage used by X applications to exchange data. With xsel, you can interact with this clipboard, including copying, pasting, and clearing its contents. It supports both primary and secondary selections and can work with various data formats such as plain text, HTML, and images. Additionally, xsel offers different command line options for controlling its behavior, like specifying the selection target, encoding, and input/output files. It is especially useful in scripting and automation tasks, allowing you to manipulate clipboard data easily without a graphical user interface. Overall, xsel is a lightweight and convenient tool for managing clipboard contents in the X Window System.

List of commands for xsel:

  • xsel:tldr:8bd86 xsel: Output the clipboard's contents into the terminal (equivalent to `Ctrl + V`).
    $ xsel -ob
    try on your machine
    explain this command
  • xsel:tldr:91474 xsel: Clear the clipboard.
    $ xsel -cb
    try on your machine
    explain this command
  • xsel:tldr:b10da xsel: Output the X11 primary selection's contents into the terminal (equivalent to a mouse middle-click).
    $ xsel -op
    try on your machine
    explain this command
  • xsel:tldr:d4e95 xsel: Output the clipboard's contents into a file.
    $ xsel -ob > ${filename}
    try on your machine
    explain this command
tool overview