Nano (Advanved) Commands

nano is a small, free and friendly editor, I’m sure everyone who uses GNU/Linux is familiar with it. Here are some, not so well known commands for it.


If you run nano -Y , for example nano -Y php it will highlight a source code. Prior to that, you need to uncomment include statements for the particular highlighter in /etc/nanorc.

All commands which are executed in combination with CTRL, can also be executed by pressing Esc key twice. So, CTRL+D could be executed with Esc Esc D.

Alt+] jump to matching open/close symbol.
ALT+A select multiple lines.
Alt+$ (Alt+Shift+4) enable soft line wrapping.
ALT+^ (ALT+SHIFT+6) copy selected region.
Alt+= scroll down, Alt+- scroll up.
Alt+} indent the selected block, and Alt+{ will outdent the block.

CTRL+R open a file.
CTRL+K cut a line or selection.
CTRL+U paste.
CTRL+A move to the beginning of line.
CTRL+E move to the end of line.
CTRL+_ move to a specific line (CTRL+V move to the bottom of file, CTRL+Y to the top).
CTRL+C show current cursor position.
CTRL+W search.
CTRL+D delete character currently under the cursor.
CTRL+\ search and replace.
CTRL+T when saving a file, opens a browser that allows you to select a file name from a list of files and directories.

This is archived version of blog, preventing broken links. This version will stay online indefinitely.