Comments on How do I send console output to the clipboard?
Parent
How do I send console output to the clipboard?
+3
−0
Suppose I have a command that prints to the standard output, like:
$ echo hi
hi
How can I send this to the clipboard instead, as if I selected the output and did Ctrl+C?
Post
+3
−0
Works for me
The following users marked this post as Works for me:
User | Comment | Date |
---|---|---|
alx | (no comment) | Jun 3, 2024 at 10:28 |
On X, echo hi | xsel -ib
seems to work. I can then paste with Ctrl+V. Sometimes I have to repeat it a few times for it to "stick".
2 comment threads
echo(1) appends a newline
(5 comments)
xsel(1) seems simpler than xclip(1)
(2 comments)
0 comment threads