Nano Editor Cheat Sheet
Modes in Nano
- Normal Editing Mode – Default; type directly into the file.
- Command Mode – Use Ctrl + key shortcuts for actions like save, exit, search, etc.
Basic Navigation
- Arrow Keys → Move up, down, left, right
- Page Up / Page Down → Scroll by pages
- Ctrl + A → Move to start of line
- Ctrl + E → Move to end of line
- Ctrl + Y → Move one page up
- Ctrl + V → Move one page down
- Ctrl + _ → Go to specific line number
Saving and Exiting
- Ctrl + O → Write out (save)
- Enter → Confirm file name
- Ctrl + X → Exit
- Ctrl + C → Show current cursor position
Cut and Paste
- Ctrl + K → Cut line
- Ctrl + U → Uncut/Paste line
- Ctrl + ^ → Start marking text (select region)
Search and Replace
- Ctrl + W → Search
- Ctrl + \ → Search and replace
- Ctrl + T → Spell check
Undo / Redo
- Nano does not have built-in undo in older versions; use cut/paste to correct mistakes.
Other Useful Commands
- Ctrl + G → Show help / list of commands
- Ctrl + J → Justify current paragraph
- Ctrl + R → Read file into current document
- Ctrl + X → Exit (prompt to save if modified)