Linux – How to select all text from a file with nano


I open a file in Ubuntu nano editor from the comand line and I want to copy all the contents of the file so I can paste it in an another application outside the shell.

So far I can only copy using shift on the screen that is visible but not on all content.

Best Answer

You can't use the buffer of nano to use it elsewhere, you need to use the buffer of X or Gnome.

xclip is the solution.

A command line interface to the X11 clipboard. It can also be used for copying files, as an alternative to sftp/scp, avoiding password prompts when X11 forwarding has already been setup.

Related Question