Thursday, May 2, 2024
18
rated 0 times [  18] [ 0]  / answers: 1 / hits: 7257  / 2 Years ago, fri, april 22, 2022, 3:25:40

I am able to copy a massive string of text but unable to paste it anywhere without the program crashing.



So, I wonder: How can I fetch it from the clipboard via CLI and save it to a file instead?



Thanks!


More From » command-line

 Answers
6

xclip is the command line interface to X selections (clipboard)



xclip -o > helloworld.c


You may need to modify the command depending on the selection you're using



   -selection
specify which X selection to use, options are "primary" to use XA_PRIMARY (default), "secondary" for XA_SECONDARY or
"clipboard" for XA_CLIPBOARD

[#33761] Friday, April 22, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ampolinhad

Total Points: 88
Total Questions: 100
Total Answers: 116

Location: South Georgia
Member since Tue, Feb 1, 2022
2 Years ago
ampolinhad questions
Thu, Sep 8, 22, 15:45, 2 Years ago
Tue, Aug 10, 21, 20:03, 3 Years ago
Sat, Oct 16, 21, 22:44, 3 Years ago
Sat, Oct 23, 21, 03:11, 3 Years ago
Thu, Nov 17, 22, 15:34, 1 Year ago
;