Skip to content

nano

Essential nano shortcuts for navigation, selecting text, find/replace and more.

Navigation

Move efficiently within a file using these commands.

Move to first line

Moves to the first line of the file.

CTRL + y

Move to last line

Moves to the last line of the file.

CTRL + v

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 next word

Moves the cursor forward one word at a time.

CTRL + SPACE

Move to line number

Moves the cursor to a specific line number.

CTRL + _

Selecting Text

Commands for selecting and cutting text.

Start selecting text

Starts marking text for cut/copy operations.

CTRL + SHIFT + 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
type word + ENTER

Search and replace

Replaces text throughout the file.

CTRL + \
search term + ENTER
replacement + ENTER

Exiting Nano

How to quit Nano safely.

Save and exit

Writes changes to file and quits.

CTRL + x
y + ENTER

Exit without saving

Closes Nano without saving changes.

CTRL + x
n

Miscellaneous

Other useful Nano commands.

Display help

Shows Nano's help documentation.

CTRL + g