Nano Cheatsheet
#
Nano is a simple, easy-to-use text editor for Unix-like systems. It is known for its straightforward interface and intuitive keyboard shortcuts.
Basic Navigation
#
Command/Option | Example | Description |
---|
Ctrl + A | Ctrl + A | Move cursor to the beginning of the line |
Ctrl + E | Ctrl + E | Move cursor to the end of the line |
Ctrl + Y | Ctrl + Y | Move up one page |
Ctrl + V | Ctrl + V | Move down one page |
Ctrl + C | Ctrl + C | Display the current cursor position |
Editing Text
#
Command/Option | Example | Description |
---|
Ctrl + K | Ctrl + K | Cut the current line |
Ctrl + U | Ctrl + U | Paste the cut line |
Ctrl + J | Ctrl + J | Justify the current paragraph |
Ctrl + T | Ctrl + T | Open the spell checker (if available) |
Ctrl + _ | Ctrl + _ | Go to a specific line number |
Search and Replace
#
Command/Option | Example | Description |
---|
Ctrl + W | Ctrl + W search_term | Search for “search_term” |
Ctrl + \ | Ctrl + \ old_text | Replace “old_text” with a new text (follow prompts) |
File Operations
#
Command/Option | Example | Description |
---|
Ctrl + O | Ctrl + O filename | Save the current file as “filename” |
Ctrl + X | Ctrl + X | Exit Nano (prompts to save if changes are made) |
Ctrl + R | Ctrl + R file_to_insert | Insert another file into the current file |
Ctrl + G | Ctrl + G | Display the help text |
Miscellaneous
#
Command/Option | Example | Description |
---|
Ctrl + C | Ctrl + C | Display the current cursor position |
Ctrl + X | Ctrl + X | Exit Nano (prompt to save changes) |
Ctrl + L | Ctrl + L | Refresh the screen |
Ctrl + Z | Ctrl + Z | Suspend the editor (return to shell) |
This cheatsheet covers the essential Nano commands and options to help you navigate, edit, and manage text efficiently in the Nano text editor.