GNU Nano is a simple, modeless terminal editor. Every keystroke is either text or a command — no modes to remember. Ideal for quick edits and SSH sessions.
Basic Keybindings
# Start Nano
nano file.txt # open or create file
nano +10 file.txt # open at line 10
nano -l file.txt # show line numbers
nano -B file.txt # create backup on save (.save)
nano -m file.txt # enable mouse support
| Key | Action | Description |
|---|
Ctrl+G | Help | Show built-in help (lists all shortcuts) |
Ctrl+O | Save | Write file to disk (prompts for filename) |
Ctrl+X | Exit | Close Nano (prompts to save if modified) |
Ctrl+K | Cut | Cut current line (or selected text) |
Ctrl+U | Paste | Paste last cut text |
Ctrl+T | Spell | Run spell checker (if configured) |
Ctrl+J | Justify | Reformat/justify current paragraph |
Navigation
| Key | Action |
|---|
Ctrl+A | Beginning of line |
Ctrl+E | End of line |
Ctrl+Y | Page up |
Ctrl+V | Page down |
Ctrl+F | Move forward one character |
Ctrl+B | Move back one character |
Ctrl+Space | Next word |
Alt+Space | Previous word |
Ctrl+_ | Go to specific line (enter line number) |
Alt+G | Go to specific line (alternative) |
Ctrl+C | Show current cursor position (line, column) |
Alt+] | Go to matching bracket |
Alt+( or Alt+) | Go to previous/next paragraph |
Search & Replace
# Search
Ctrl+W # search forward
Alt+W # search backward
Alt+Q # search without regex
# Replace
Ctrl+\ # search and replace (prompted)
# Enter search text, press Enter
# Enter replacement text
# Y = replace this, N = skip, A = replace all, Ctrl+C = cancel
Cut, Copy & Paste