Skip to content

Instantly share code, notes, and snippets.

@dohaivu
Last active May 26, 2018 02:26
Show Gist options
  • Save dohaivu/a4f5a6967bd052466083012a0dddb5a0 to your computer and use it in GitHub Desktop.
Save dohaivu/a4f5a6967bd052466083012a0dddb5a0 to your computer and use it in GitHub Desktop.
[nano command] #tool

^G nano help

Starting nano

To edit a file called filename, type nano filename.
In nano, you can insert another file:
^R read an existing file into nano (inserted at the current cursor position)
^T opens a browser that allows you to select a file name from a list of files and directories

Navigation

^A move to beginning of line
^E move to end of line
^Y move down a page
^V move up a page
^_ move to a specific line (^^V moves to the end of the file, ^^Y to the top)
^C find out what line the cursor is currently on
^W search for some text.
When searching, you will be prompted for the text to search for. It searches from the current cursor position, wrapping back up to the top if necessary.

Editing

Delete commands:

^D delete character currently under the cursor
BackSpace delete character currently in front of the cursor
^K delete entire line
^\ search for (and replace) a string of characters

Cut and paste

^K does not delete lines permanently;
^U. This may be used to simulate cut and paste:

Saving and Exiting

^O save contents without exiting (you will be prompted for a file to save to)
^X exit nano (you will be prompted to save your file if you haven't)
^T when saving a file, opens a browser that allows you to select a file name from a list of files and directories

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment