← 返回命令列表

Linux command

nano 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Open file

nano [file.txt]

Open at specific line

nano +[10] [file.txt]

Open read-only

nano -v [file.txt]

Enable line numbers

nano -l [file.txt]

Disable line wrapping

nano -w [file.txt]

Open with backup

nano -B [file.txt]

Set tab size

nano -T [4] [file.txt]

说明

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.

参数

+ _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.

FAQ

What is the nano command used for?

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.

How do I run a basic nano example?

Run `nano [file.txt]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does + _LINE_ do in nano?

Start at line number.