Opening a File:
nano filename
: Open a file for editing.
Basic Navigation:
Arrow keys
: Move the cursor.
Ctrl + B
: Move one page up.
Ctrl + F
: Move one page down.
Ctrl + A
: Move to the beginning of the current line.
Ctrl + E
: Move to the end of the current line.
Ctrl + Y
: Scroll up one line.
Ctrl + V
: Scroll down one line.
Editing Text:
Ctrl + Space
: Set a mark.
Ctrl + ^
(Ctrl + Shift + 6): Copy the marked text.
Ctrl + K
: Cut the marked text.
Ctrl + U
: Paste the cut or copied text.
Ctrl + T
: To spell-check your text (if spell-checking is supported).
Saving and Exiting:
Ctrl + O
: Save the file (You’ll be prompted for the filename).
Ctrl + X
: Exit Nano.
If you made changes and haven’t saved, Nano will prompt you to save before exiting.
Search and Replace:
Ctrl + W
: Search for text.
Ctrl + R
: Replace text.
Alt + W
: Repeat the last search.
Line Manipulation:
Ctrl + C
: Display the current line and cursor position.
Alt + U
: Convert the selected text to uppercase.
Alt + L
: Convert the selected text to lowercase.
Alt + C
: Capitalize the first letter of each word in the selected text.
Alt + T
: Transpose (swap) characters.
Alt + \
: Go to the beginning of the file.
Alt + /
: Go to the end of the file.
Other Commands:
Ctrl + G
: Get help (Nano’s help menu).
Ctrl + P
: Enable or disable the “constant cursor” option.
Ctrl + ]
: Indent the current line.
Ctrl + [
: Unindent the current line.
Remember that the exact keybindings may depend on your system configuration and Nano version. You can usually find more information in the Nano documentation by typing man nano
in the terminal or by using nano --help
.