Comments on Command-Line Copy&Paste With xclip (Debian/Ubuntu)
Command-Line Copy&Paste With xclip (Debian/Ubuntu) xclip is a command line interface to the X11 clipboard. It allows you to put the output of a command directly into the clipboard so that you don't have to copy&paste from the terminal manually (which can be a tedious task especially if the output is very long). It also allows you to put the contents of a file directly into the clipboard.
4 Comment(s)
Comments
o " ls -la | gedit " - doesn't work
o gedit http://www.gnome.org - sweet
o " having some special program load it into the magic 'clipboard' seems a rather confused approach. But thats whats wonderfing about unix/linux, there are so many ways to do the same thing, and even terribly confused people can come up with new ways, if it somehow makes sense to them." - snarky much ?
For the first example, why not just save the output of a command to a temporary file? And then load that file with the editor?
ls -la > /tmp/dirlisting
gedit /tmp/dirlisting
Or even skip the temp file, and let gedit load it directly (Yes you can launch gedit from the CLI, and yes, it can load content from its standard input - http://www.digipedia.pl/man/view/doc/gedit.1.html )
ls -la | gedit
And if you want to load it into some text from a file into a gedit session you have open already with other text, I'm sure somewhere under 'file' or 'edit' there is 'insert file'
For the second, why put a file into some magic place called a 'clipboard', just to paste it into something else? Why not just load it directly from the file into the 'something else'?
It would be very useful for collecting clips of text in a file. But results are poor because of its lack of support of unicode.
Can't get this to work at all in Ubuntu 16. Wherever that text is going, it certainly isn't to the main clipboard.