Here's another solution. One that I personally prefer.
It uses Xsel. It's very similar to Xclip but with a key difference.
$ cat my_funky_file | xsel
While Xclip puts everything in the main clipboard, Xsel manipulates the selection buffer letting you paste the selection with a middle-click. This is great for one-offs! So if you have something in your clipboard that you haven't pasted yet, that would stay unaffected!
And if you want to paste the content, xsel -o will spit it right out.
You can install it on a debian based system using
$ apt-get install xsel
The source is available here otherwise! Hope this helps someone.
Question is too vague and the answers are all over the map as a result, leading to confusion. Typically you use nano on a remote server, not your desktop computer. This sounds more like a question about your terminal emulator, which is how you access nano. I really think the question should be changed or flagged for removal. – PJ Brunet – 2016-12-14T19:13:33.887
Agree with above the answers here are confusing – Joel Davey – 2017-02-09T10:21:46.270
Thats why
vimis much better. – Black – 2017-05-29T08:25:29.097Are you in a command line only environment? If not, why don't you open the file in something like gedit? – MBraedley – 2010-10-06T10:50:46.957
4I don't have gedit on that machine and I want to learn to do it in nano. – Elzo Valugi – 2010-10-06T14:09:29.860
try cat command and copy the content. – Ashish Viradiya – 2019-05-28T05:28:48.243
4Btw this is why I hate linux and the command-line: In theory a wonderful thing, but in reality extremely unuintutive, even the most simple and common things don't work like expected. Usability Super-Fail. – Sliq – 2013-09-16T21:08:54.223
3nano is not powerful. just to edit some config files it is pretty ok, but as an code editor it sucks! – deepcell – 2014-01-17T16:32:32.033