How do I select all text from a file with nano?

Solution 1:

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.

Solution 2:

There is a possible way:

  • Cursor at the beginning of a file

  • Ctrl6 to set a mark

  • AltShiftT (or try AltT) to cut to the end of the file

  • If AltT doesn't work, try CtrlK

  • to just copy the file content do CtrlU to uncut the text again

Solution 3:

you can use cat and then copy it from the console:

cat path/to/file.yml

Select the output printed in the console.