Beginner · 6 min · practise every command in the built-in terminal

nano — Easy Terminal Editor

nano is much simpler than vim. All shortcuts are shown at the bottom.

Open a file

nano filename.txt
nano +50 filename.txt    # Open at line 50

Keyboard shortcuts

The ^ symbol means Ctrl.

ShortcutAction
^XExit
^OSave (Write Out)
^WSearch
^GHelp
^KCut line
^UPaste
^AStart of line
^EEnd of line
^YPage up
^VPage down
^\\Find and replace

Useful flags

nano -l file.txt         # Show line numbers
nano -m file.txt         # Enable mouse
nano -B file.txt         # Backup before editing

Save and exit

  1. Press Ctrl+X
  2. Press Y to confirm save
  3. Press Enter to keep filename

nano vs vim: nano is better for quick edits. vim is better once mastered.

Practice tasks

  1. Open nano, create a file, write some text, and save it
  2. Open a file in nano starting at a specific line number

Commands in this lesson

Advanced Commands