1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2024-10-31 16:18:00 +01:00

Merge pull request #928 from tldr-pages/xsel

simplify xsel.md, add example using X11 selection
This commit is contained in:
Leandro Ostera 2016-06-27 11:09:06 +02:00 committed by GitHub
commit 211ac32f3e

View file

@ -1,36 +1,27 @@
# xsel # xsel
> Selection manipulation tool. > X11 selection and clipboard manipulation tool.
> For example, xsel can copy STDIN to clipboard, or print clipboard to STDOUT.
- Clipboard selection: - Use a command's output as input of the clip[b]oard (equivalent to Ctrl+C):
`-b or --clipboard` `echo 123 | xsel -ib`
- Primary selection: - Use the contents of a file as input of the clipboard:
`-p or --primary` `cat {{file}} | xsel -ib`
- Secondary selection: - Output the clipboard's contents into the terminal (equivalent to Ctrl+V):
`-s or --secondary` `xsel -ob`
- Copy output of a command into the clipboard: - Output the clipboard's contents into a file:
`echo 123 | xsel -bi` `xsel -ob > {{file}}`
- Copy contents of a file into the clipboard:
`cat {{file}} | xsel -bi`
- Print the clipboard to STDOUT:
`xsel -bo`
- Print the clipboard into a file:
`xsel -bo > {{file}}`
- Clear the clipboard: - Clear the clipboard:
`xsel -bc` `xsel -cb`
- Output the X11 primary selection's contents into the terminal (equivalent to a mouse middle-click):
`xsel -op`