Text editors in Linux: nano and vim
Updated July 3, 2026
nano and vim are text editors right in the terminal; nano is easier to start with, vim is on almost every machine.
Common cases
nano file.txt # open a file in nano
# in nano: Ctrl+O save, Ctrl+X quit
vim file.txt # open a file in vim
# in vim: i insert, Esc back, :w save, :q quit, :wq both
vim -R file.txt # read-onlyHow it works: vim's modes and how to quit
nanoworks like a familiar editor: open it, type, and the hints at the bottom useCtrl.vimis built around modes, and that trips people up. When it opens you are in normal mode: letters are commands, not text. Pressito start typing, andEscto go back. The most common question is how to quit: pressEsc, then type:qand Enter (or:q!to quit without saving,:wqto save and quit). If the editor is unfamiliar, usenano.
In the book
This topic is covered in full in the chapter Reading and editing text.