Skip to content

nano

Shortcut keys for editing, navigating and managing text inside the Nano editor.

Navigation

Move efficiently within a file using these commands.

Move to first line

Moves to the first line of the file.

CTRL + y
or
ESC + \

Move to last line

Moves to the last line of the file.

CTRL + v
or
ESC + /

Move to beginning of line

Moves the cursor to the start of the current line.

CTRL + a

Move to end of line

Moves the cursor to the end of the current line.

CTRL + e

Move to previous line

Moves the cursor to the previous line.

CTRL + p

Move to next line

Moves the cursor to the next line.

CTRL + n

Move to previous word

Moves the cursor backward one word at a time.

CTRL +
or
ALT + SPACE

Move to next word

Moves the cursor forward one word at a time.

CTRL +
or
CTRL + SPACE

Move to line number

Moves the cursor to a specific line number.

CTRL + _
or
ESC + g

Selecting Text

Commands for selecting and cutting text.

Start selecting text

Starts marking text for cut/copy operations.

CTRL + SHIFT + 6
or
ESC + a

Copy selected text

Copies the selected text and stores it in the buffer.

ALT + 6
or
ESC + 6

Cut selected text

Cuts the selected text and stores it in the buffer.

CTRL + k

Paste text

Pastes the last cut text.

CTRL + u

Search and Replace

Find text and perform replacements efficiently.

Search for a word

Finds the next occurrence of a word in the file.

CTRL + w
or
ESC + f
type word > ENTER

Search and replace

Replaces text throughout the file.

CTRL + \
or
ESC + r
search term > ENTER > replacement > ENTER

Find next occurrence

Jump to the next match in the current search.

ALT + w
or
ESC + w

Exiting Nano

How to quit Nano safely.

Save and exit

Writes changes to file and quits.

CTRL + x
or
y + ENTER

Exit without saving

Closes Nano without saving changes.

CTRL + x
or
n

Miscellaneous

Other useful Nano commands.

Display help

Shows Nano's help documentation.

CTRL + g

Undo

Revert the most recent change.

ALT + u
or
ESC + u

Redo

Reapply the most recently undone change.

ALT + e
or
ESC + e