tldr/pages/linux/xsel.md

29 lines
624 B
Markdown
Raw Normal View History

2016-06-20 23:36:03 +01:00
# xsel
> X11 selection and clipboard manipulation tool.
> More information: <https://manned.org/xsel>.
2016-06-20 23:36:03 +01:00
- Use a command's output as input of the clip[b]oard (equivalent to `Ctrl + C`):
2016-06-20 23:36:03 +01:00
`echo 123 | xsel -ib`
2016-06-20 23:36:03 +01:00
- Use the contents of a file as input of the clipboard:
2016-06-20 23:36:03 +01:00
2022-12-04 09:12:49 +00:00
`cat {{path/to/file}} | xsel -ib`
2016-06-20 23:36:03 +01:00
- Output the clipboard's contents into the terminal (equivalent to `Ctrl + V`):
2016-06-20 23:36:03 +01:00
`xsel -ob`
2016-06-20 23:36:03 +01:00
- Output the clipboard's contents into a file:
2016-06-20 23:36:03 +01:00
2022-12-04 09:12:49 +00:00
`xsel -ob > {{path/to/file}}`
2016-06-20 23:36:03 +01:00
- Clear the clipboard:
2016-06-20 23:36:03 +01:00
`xsel -cb`
2016-06-20 23:36:03 +01:00
2016-06-25 09:43:21 +01:00
- Output the X11 primary selection's contents into the terminal (equivalent to a mouse middle-click):
2016-06-20 23:36:03 +01:00
`xsel -op`