Skip to the workspace
Pebellslearn by building
Editing Files  ›  Capstone Project

Nano — The Editor That Shows Its Keys

Nano 12 minNano has no modes, so typing inserts text, and every command is a Ctrl or Alt shortcut listed at the bottom of the screen.

linux / Nano — The Editor That Shows Its Keys

Explore each scene at your own pace.

01 · The rule

The rule

Nano — The Editor That Shows Its Keys

Not every edit is worth learning a new way of thinking. When Asha just needs to change one line in a config file, Nano is the quickest way in. It has no modes, and a list of shortcuts sits at the bottom of the screen the whole time.

The rule

Nano types what you press; Ctrl does the rest.

$ nano ~/garden/notes.txt

As soon as the file opens, you can type and the text goes in, just like a normal text box. Every command is a key combination, and the most useful ones are listed along the bottom edge. You only need to know how that list is written:

  • ^ means Ctrl. So ^X is Ctrl+X.
  • M- means Meta, which is usually Alt (or Esc on some keyboards). So M-U is Alt+U.

The keys you'll use every day:

Shortcut Nano calls it Does
^O Write Out save the file; press Enter to confirm the name
^X Exit quit, asking whether to save if there are changes
^K Cut cut the whole current line
^U Paste paste the last cut text
^W Where Is search
^_ Go To Line jump to a line number
M-U Undo undo the last change
^G Help show every shortcut

When you press ^X with unsaved changes, Nano asks "Save modified buffer?" and you answer Y or N. If you say Y, it shows the filename; press Enter to keep it.

Scene 1 of 5
Hover to wake the cannons. Drag to move, or use arrow keys when focused. Press Enter to fire a shot.