LinuxCommandLibrary

nano

TLDR

Open file

$ nano [file.txt]
copy
Open at specific line
$ nano +[10] [file.txt]
copy
Open read-only
$ nano -v [file.txt]
copy
Enable line numbers
$ nano -l [file.txt]
copy
Disable line wrapping
$ nano -w [file.txt]
copy
Open with backup
$ nano -B [file.txt]
copy
Set tab size
$ nano -T [4] [file.txt]
copy

SYNOPSIS

nano [options] [file]

DESCRIPTION

nano is a simple text editor. It provides an easy-to-use terminal editor.
The tool shows shortcuts at bottom. Beginner-friendly alternative to vi/vim.
nano is simple terminal editor.

PARAMETERS

FILE

File to edit.
+ LINE
Start at line number.
-v
View mode (read-only).
-l
Show line numbers.
-w
Don't wrap long lines.
-B
Create backup files.
-T NUM
Tab size.
--help
Display help information.

CAVEATS

Less powerful than vim/emacs. Ctrl-based shortcuts. Config in ~/.nanorc.

HISTORY

nano was created as a free replacement for the Pico editor, part of the GNU project since 2001.

SEE ALSO

vim(1), emacs(1), pico(1)

Copied to clipboard