Commands · Command

CommandLinuxmacOS

nano

nano [file]

A simple, beginner-friendly terminal text editor — opens a file for editing directly in the terminal, with on-screen shortcut hints.

// FLAGS

-wdisable line wrapping
-lshow line numbers
-Bback up the original file before saving

// EXAMPLE

nano /etc/hosts — opens the hosts file for editing; Ctrl+O saves, Ctrl+X exits.

// GOTCHA

New users often expect Ctrl+S to save (as in most GUI apps) — nano uses Ctrl+O ("WriteOut") instead, and Ctrl+S can even freeze the terminal (XOFF) on some setups.

// RELATED COMMANDS