Nano Commands

Essential Nano editor commands and keyboard shortcuts.

File Operations

Ctrl+O

Save file (WriteOut)

Ctrl+X

Exit nano

Ctrl+R

Read file (insert file at cursor)

Ctrl+J

Justify current paragraph

Alt+D

Count words, lines, characters

Navigation

Arrow Keys

Move cursor up, down, left, right

Ctrl+A

Move to beginning of line

Ctrl+E

Move to end of line

Ctrl+Y

Scroll up one page

Ctrl+V

Scroll down one page

Ctrl+_

Go to line and column number

Alt+\

Go to first line

Alt+/

Go to last line

Ctrl+Space

Move forward one word

Alt+Space

Move backward one word

Editing

Ctrl+K

Cut current line

Ctrl+U

Paste cut text

Alt+6

Copy current line

Ctrl+6

Mark text (start selection)

Alt+A

Mark text (set mark)

Ctrl+D

Delete character at cursor

Backspace

Delete character before cursor

Alt+Delete

Delete word to the right

Ctrl+T

Execute external command

Search & Replace

Ctrl+W

Search for text

Alt+W

Find next occurrence

Alt+Q

Find previous occurrence

Ctrl+\

Search and replace

Alt+R

Search and replace (interactive)

Undo & Redo

Alt+U

Undo last action

Alt+E

Redo last undone action

Special Features

Ctrl+G

Display help text

Alt+X

Toggle help mode

Alt+C

Show cursor position

Alt+#

Toggle line numbers

Alt+P

Toggle whitespace display

Alt+Y

Toggle syntax highlighting

Alt+O

Toggle one-line mode

Ctrl+L

Refresh screen

Advanced

Alt+}

Indent current line

Alt+{

Unindent current line

Alt+3

Comment/uncomment line

Alt+]

Complete current word

Ctrl+]

Complete current bracket

Alt+T

Cut to end of file

Alt+J

Justify entire file

Alt+B

Toggle backup files

Alt+F

Toggle multiple file buffers

Alt+<

Switch to previous file buffer

Alt+>

Switch to next file buffer