Nano Editor Keyboard Shortcuts

GNU nano is the most accessible text editor for the Linux command line, favored for its simplicity and ease of use. Unlike more complex editors like Vim or Emacs, nano keyboard shortcuts are always visible at the bottom of the screen, but mastering the advanced combinations is the key to efficient server administration and configuration file editing. Whether you are a DevOps engineer or a Linux enthusiast, knowing these default keybindings allows you to navigate and edit files directly in the terminal without a GUI.

This guide provides a comprehensive list of nano shortcuts for the 2026 version. From basic file saving to advanced search-and-replace and block-indentation techniques, these hotkeys are essential for anyone working in a terminal environment. Note that in nano documentation, the ^ symbol represents the Ctrl key and M- represents the Meta key (usually Alt or Esc).

Essential File and Session Controls

These shortcuts handle the core operations of opening, saving, and exiting the editor.

ActionKeyboard Combination
Exit NanoCtrl + X
Write Out (Save)Ctrl + O
Read File (Insert File)Ctrl + R
Get Help ScreenCtrl + G
Justify Current ParagraphCtrl + J
Suspend NanoCtrl + Z

Navigation and Cursor Movement

Moving through large configuration files is much faster with dedicated navigation hotkeys.

ActionKeyboard Combination
Go to Line NumberCtrl + _ (Underscore)
Go to Beginning of LineCtrl + A
Go to End of LineCtrl + E
Go to Next PageCtrl + V
Go to Previous PageCtrl + Y
Next WordCtrl + Space
Previous WordAlt + Space
Go to Matching BracketAlt + ]

Editing and Text Manipulation

These shortcuts allow for rapid cutting, pasting, and modifying text blocks.

ActionKeyboard Combination
Cut Current Line (Kut)Ctrl + K
Uncut (Paste) Line (Unkut)Ctrl + U
Copy Line (without cutting)Alt + 6
Set Mark (Selection Mode)Alt + A
Undo Last ActionAlt + U
Redo Last ActionAlt + E
Delete Character at CursorCtrl + D
Delete Character to LeftCtrl + H (or Backspace)
Indent Marked RegionAlt + }
Unindent Marked RegionAlt + {

Search and Replace Shortcuts

Finding specific variables or strings in a script is efficient with these search tools.

ActionKeyboard Combination
Where Is (Search)Ctrl + W
Replace StringCtrl + \
Find NextAlt + W
Find PreviousAlt + Q
Count Words / LinesCtrl + D

Interface and Toggle Features

Customize how nano displays your code or text with these real-time toggles.

ActionKeyboard Combination
Toggle Line NumbersAlt + N
Toggle Syntax HighlightingAlt + Y
Toggle Soft WrapAlt + $
Toggle Mouse SupportAlt + M
Toggle Smooth ScrollingAlt + S

Professional Tip: The “Mark” Selection Workflow

To edit a specific block of text rather than an entire line, use the Alt + A shortcut to set a “Mark.” Once the mark is set, use your arrow keys to highlight the desired area. You can then use Ctrl + K to cut just the highlighted section or Alt + 6 to copy it. To cancel the selection, simply press Alt + A again.

Most of these nano default controls are configured in the .nanorc file located in your home directory. If you frequently use nano for coding, enabling features like set linenumbers and set syntax on in that configuration file will make your terminal experience much more powerful.