Nano is a lightweight, beginner-friendly terminal text editor for Linux and Unix systems. Unlike Vim or Emacs, Nano shows available commands at the bottom of the screen, making it easy to get started. This guide covers every essential shortcut you need.

Navigation Shortcuts
| Shortcut | Action |
|---|
Ctrl + A | Jump to the beginning of the current line |
Ctrl + E | Jump to the end of the current line |
Ctrl + Y | Scroll one page up |
Ctrl + V | Scroll one page down |
Ctrl + _ | Go to a specific line and column number |
Ctrl + C | Show current cursor position (line / column / character) |
File Operations
| Shortcut | Action |
|---|
Ctrl + O | Save (write out) the file — Nano will prompt to confirm the filename |
Ctrl + X | Exit Nano — prompts to save if unsaved changes exist |
Ctrl + R | Open a file and insert its contents at the current cursor position |
Editing Shortcuts
| Shortcut | Action |
|---|
Ctrl + K | Cut the entire current line (or selected text) to the cut buffer |
Ctrl + U | Paste (uncut) text from the cut buffer at the current position |
Ctrl + J | Justify (reflow) the current paragraph |
Ctrl + \ | Find and replace a string or regular expression |
Alt + A | Toggle text selection mode — combine with Ctrl + K to cut a specific region |
Search Shortcuts
| Shortcut | Action |
|---|
Ctrl + W | Search for a phrase in the file |
Alt + W | Repeat the last search (find next occurrence) |
Miscellaneous
| Shortcut | Action |
|---|
Ctrl + G | Open the Help window with a full list of available commands |
Ctrl + T | Invoke the spell checker (if installed on your system) |
Quick Tips
- Ctrl + K + U combo — Cut a line with
Ctrl + K then paste it elsewhere with Ctrl + U. This is the fastest way to move lines.
- Multiple cut — Press
Ctrl + K multiple times in a row to cut multiple lines into the buffer at once, then paste them all with a single Ctrl + U.
- Selection + Cut — Use
Alt + A to start marking text, move the cursor to select a region, then Ctrl + K to cut only that selection.
- Go to line — Use
Ctrl + _ when you know exactly which line has an error (useful when a compiler reports a line number).
Installing Nano
Nano is pre-installed on most Linux distributions. If it’s missing, install it with:
# Debian / Ubuntu
sudo apt install nano
# RHEL / CentOS / Fedora
sudo dnf install nano
# macOS (via Homebrew)
brew install nano
Nano is an excellent tool for quick server-side edits, config file changes, and scripting — especially when a graphical editor isn’t available.