Save last "copy" from clipboard to file
6,505
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
Related videos on Youtube
Author by
Nathan J.B.
Updated on September 18, 2022Comments
-
Nathan J.B. over 1 year
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!
-
Nathan J.B. over 11 yearsThanks! I've used this before but I couldn't remember the command for the life of me!
-
Pablo Bianchi over 6 yearsFor images you might need
-t image/png
.