Thursday, April 25, 2024
5
rated 0 times [  5] [ 0]  / answers: 1 / hits: 3226  / 2 Years ago, thu, january 6, 2022, 2:12:12

How do i write data from the Command-line into the copy paste buffer?
I see the programs xsel, and xclip and they look fine, but i would prefer a command line option. Can i redirect terminal output to the buffer some how? What is the technical name for the copy paste buffer?



I use mate for the desktop environment. The reason I want to be able to do this without installing anything is I want to be able to write scripts to use this function even on systems where i am not an administrator... i know i can compile in my home directory, but i would still prefer a standard output method. I wouldnt mind writing a bit of c-code to do it either.



I am still not certain, perhaps the copy paste buffers are just frame buffers?


More From » command-line

 Answers
2

To redirect STDOUT to the X11 clipboard, you can pipe it into xclip:



$  echo -n my example text to STDOUT | xclip -i -selection clipboard


You can see what's in the clipboard with:



$  xclip -o -selection clipboard


See xclip man page for more details.


[#28561] Friday, January 7, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ainbby

Total Points: 184
Total Questions: 115
Total Answers: 112

Location: Colombia
Member since Thu, Sep 29, 2022
2 Years ago
ainbby questions
Thu, Mar 23, 23, 10:26, 1 Year ago
Wed, May 10, 23, 00:10, 1 Year ago
Fri, Apr 15, 22, 10:11, 2 Years ago
;