nano
Simple, beginner-friendly terminal text editor with on-screen shortcut hints.
Synopsis
nano [OPTION]... [FILE]...
Examples
nano file.txt
nano +10 file.txt
nano -l -m config.yml
nano -B /etc/hosts
Common options
| Flag | Description |
|---|---|
| -l | Show line numbers |
| -m | Enable mouse support |
| -i | Auto-indent new lines |
| -B | Back up the file before editing |
| -c | Constantly show cursor position |
About nano
The `nano` command simple, beginner-friendly terminal text editor with on-screen shortcut hints. Text viewing and editing commands are fundamental tools in any Linux user's toolkit.
Linux treats almost everything as a file, so the ability to quickly inspect, filter, transform, and edit file contents from the command line is critical. These commands are regularly combined with pipes and redirects to build powerful data-processing pipelines.
The command accepts 5 commonly used flags shown above, though the full set of options is available in the man page (`man nano`). The 4 examples on this page cover typical real-world usage patterns that you can copy and adapt for your own workflows.
Related commands
More File Viewing & Editing Commands
Other commands in the File Viewing & Editing category