Cheat Sheets Help

Nano

Basic Commands

Open a file in Nano

nano <file_name>

Save changes to a file

  • Press Ctrl + O then press Enter

Exit Nano

  • Press Ctrl + X

Save and exit Nano

  • Press Ctrl + X, then press Y to save, followed by Enter

Open Nano without file wrapping

nano -w <file_name>

Move the cursor to the beginning of a line

Ctrl + A

Move the cursor to the end of a line

Ctrl + E

Move the cursor to the next word

Ctrl + Space

Move the cursor to the previous word

Ctrl + Left

Go to a specific line and column

Ctrl + _

Cut, Copy, and Paste

Cut a line

Ctrl + K

Copy a line

Ctrl + Shift + 6 (to start marking), then move the cursor to select text, and press `Ctrl + K`

Paste text

Ctrl + U

Search and Replace

Search for a term

Ctrl + W

Repeat the last search

Alt + W

Find and replace a term

Ctrl + \ (Then enter the search term and replacement term)

File Management

Open a new file in Nano

Ctrl + R

Save a file with a new name

Ctrl + O, then enter the new file name and press `Enter`

Miscellaneous

Show help menu

Ctrl + G

Display line numbers

nano -c <file_name>

Enable mouse support

nano -m <file_name>

Justify text (align text)

Ctrl + J
Last modified: 08 September 2024