tldr/pages/linux/xsel.md

37 lines
535 B
Markdown
Raw Normal View History

2016-06-20 23:36:03 +01:00
# xsel
> Selection manipulation tool.
> For example, xsel can copy STDIN to clipboard, or print clipboard to STDOUT.
- Clipboard selection:
`-b or --clipboard`
- Primary selection:
`-p or --primary`
2016-06-20 23:39:56 +01:00
- Secondary selection:
2016-06-20 23:36:03 +01:00
`-s or --secondary`
- Copy output of a command into the clipboard:
`echo 123 | xsel -bi`
2016-06-20 23:36:03 +01:00
- Copy contents of a file into the clipboard:
`cat {{file}} | xsel -bi`
2016-06-20 23:36:03 +01:00
- Print the clipboard to STDOUT:
`xsel -bo`
- Print the clipboard into a file:
`xsel -bo > {{file}}`
- Clear the clipboard:
`xsel -bc`