Nano Keyboard Shortcuts
File Management & Basics
| Shortcut | Action |
|---|---|
Ctrl + O | Write Out — Save the current file changes |
Ctrl + X | Exit nano; prompts to save unsaved changes |
Ctrl + R | Insert another file at the cursor position |
Ctrl + G | Open the Help menu |
Searching & Replacing
| Shortcut | Action |
|---|---|
Ctrl + W | Search for a keyword (Where Is) |
Alt + W | Repeat the last search forward |
Ctrl + \ / Alt + R | Search and replace text throughout the file |
Editing, Cutting & Pasting
| Shortcut | Action |
|---|---|
Ctrl + K | Cut the entire current line |
Ctrl + U | Paste the text you just copied or cut |
Alt + 6 | Copy the current line without deleting it |
Alt + A | Set the mark; use arrow keys to select text |
Ctrl + J | Justify/wrap the current paragraph |
Navigation & Scrolling
| Shortcut | Action |
|---|---|
Ctrl + A | Move to the beginning of the current line |
Ctrl + E | Move to the end of the current line |
Ctrl + Y | Page up — scroll up one screen |
Ctrl + V | Page down — scroll down one screen |
Alt + \ | Jump to the very top of the file |
Alt + / | Jump to the very bottom of the file |
View & Interface Toggles
| Shortcut | Action |
|---|---|
Alt + N | Toggle line numbers on/off |
Alt + $ | Toggle soft wrapping |
Ctrl + C | Show cursor position — line, column, and character count |