Complete Nano keyboard shortcuts reference — 66 shortcuts across 9 categories. Quick reference cheat sheet for Linux & Mac.
nano is the editor you meet when a server has nothing else installed, and its shortcuts are printed along the bottom of the screen — the caret means Ctrl and M- means Alt (Meta). The table expands those into full key names. Recent nano versions added the Ctrl + S and undo bindings that people used to complain were missing, so the rows below assume nano 4.0 or later, which every current distribution ships.
| Shortcut | Action |
|---|---|
| Ctrl + S | Save File |
| Ctrl + O | Save As |
| Ctrl + R | Insert File |
| Ctrl + X | Exit |
| Ctrl + G | Display Help |
| Shortcut | Action |
|---|---|
| Ctrl + K | Cut Line |
| Alt + 6 | Copy Line |
| Ctrl + U | Paste |
| Ctrl + ] | Complete Word |
| Alt + 3 | Comment Line |
| Alt + U | Undo |
| Alt + E | Redo |
| Shortcut | Action |
|---|---|
| Ctrl + H | Delete Character Left |
| Ctrl + D | Delete Character |
| Alt + Backspace | Delete Word Left |
| Ctrl + Delete | Delete Word Right |
| Alt + Delete | Delete Line |
| Shortcut | Action |
|---|---|
| Ctrl + F | Search Forward |
| Ctrl + B | Search Backward |
| Alt + F | Find Next Forward |
| Alt + B | Find Next Backward |
| Alt + R | Replace |
| Shortcut | Action |
|---|---|
| Ctrl + T | Execute Command |
| Ctrl + T, Ctrl + S | Spell Check |
| Ctrl + T, Ctrl + Y | Syntax Check |
| Ctrl + T, Ctrl + O | Run Formatter |
| Tab | Indent Region |
| Shift + Tab | Unindent Region |
| Ctrl + J | Justify Paragraph |
| Alt + J | Justify Buffer |
| Alt + T | Cut to End of Buffer |
| Alt + V | Verbatim Input |
| Alt + : | Record Macro |
| Alt + ; | Replay Macro |
| Shortcut | Action |
|---|---|
| Ctrl + Left | Word Backward |
| Ctrl + Right | Word Forward |
| Ctrl + A | Start of Line |
| Ctrl + E | End of Line |
| Ctrl + P | Line Up |
| Ctrl + N | Line Down |
| Ctrl + Up | Previous Block |
| Ctrl + Down | Next Block |
| Alt + Home | First Row in View |
| Alt + End | Last Row in View |
| Ctrl + Y | Page Up |
| Ctrl + V | Page Down |
| Alt + \ | Top of Buffer |
| Alt + / | End of Buffer |
| Shortcut | Action |
|---|---|
| Alt + G | Go to Line |
| Alt + ] | Matching Bracket |
| Alt + < | Scroll Left |
| Alt + > | Scroll Right |
| Alt + Up | Scroll Viewport Up |
| Alt + Down | Scroll Viewport Down |
| Ctrl + L | Center Line |
| Alt + Left | Previous Buffer |
| Alt + Right | Next Buffer |
| Shortcut | Action |
|---|---|
| Ctrl + C | Report Cursor Position |
| Alt + D | Report Counts |
| Shortcut | Action |
|---|---|
| Alt + A | Set Mark |
| Alt + C | Constant Position Info |
| Alt + N | Line Numbers |
| Alt + P | Visible Whitespace |
| Alt + S | Soft Wrapping |
| Alt + X | Hide Help Lines |
| Alt + Z | Hide Info Bars |
Ctrl + S saves in place and Ctrl + X exits, offering to save if the buffer changed — answer Y, then confirm the file name with Enter. Ctrl + O is "write out", the older save-as flow that prompts for a name each time. If you are stuck at a prompt, Ctrl + C cancels it; in the main editor the same key reports the cursor position instead. Ctrl + G opens the help screen, which lists every binding for the installed version.
Ctrl + K cuts the current line into the cut buffer and Ctrl + U pastes it; pressing Ctrl + K on consecutive lines accumulates them, so cut-five-lines-and-move-them is five presses and one paste. Alt + 6 copies a line without removing it. To act on a region instead of whole lines, set a mark with Alt + A, move the cursor to extend the selection, then cut or copy. Alt + U undoes and Alt + E redoes.
Ctrl + A and Ctrl + E go to line start and end, Ctrl + Left and Ctrl + Right move by word, and Ctrl + Y and Ctrl + V page up and down — assignments that look random until you notice they avoid keys the terminal reserves. Alt + G goes to a line number and Alt + \ and Alt + / jump to the top and bottom of the file. Ctrl + F searches forward (older builds used Ctrl + W), and Alt + R opens search-and-replace with a confirmation for each match.
Alt + N shows line numbers, Alt + S soft-wraps long lines so they are readable without horizontal scrolling, and Alt + P shows whitespace, which is how you find the tab-versus-spaces problem in a YAML file. Alt + 3 comments or uncomments the current line using the syntax's comment character. These can be made permanent in ~/.nanorc.
^ is Ctrl and M- is Alt (Meta). ^X means Ctrl + X; M-U means Alt + U.
Press Alt + A to set a mark, move the cursor to extend the selection, then Ctrl + K to cut or Alt + 6 to copy it.
Ctrl + S was added in nano 4.0. On older versions use Ctrl + O then Enter, and make sure the terminal is not treating Ctrl + S as flow control.
Alt + G, then type the line number and press Enter. You can also start nano with +N filename to open at line N.
Open your assistant with this page preloaded as the source — great for follow-up questions like "which of these work in other apps?"