We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nl
nl 命令用来显示文件内容并加上行号
与 cat 不同的是,nl 对行号可以有比较多的显示设置
cat
nl [选项] 文件……
-b:指定行号显示的方式
-b
-b a
cat -n
-b t
-n:列出行号显示的方法
-n
-n ln
-n rn
-n rz
-w {n}
行号占用的位数
列出文件 a.log 的内容,空白行不列出行号
a.log
nl a.log
同 nl -b t a.log
nl -b t a.log
空白行列出行号
nl -b a a.log
行号自动补 0(补位数按默认)
nl -b a -n rz a.log
行号自动补 0(设定补位数)
nl -b a -n rz -w 3 a.log
The text was updated successfully, but these errors were encountered:
No branches or pull requests
day 10 - linux 命令 :
nl
nl
命令用来显示文件内容并加上行号与
cat
不同的是,nl
对行号可以有比较多的显示设置语法
选项
-b
:指定行号显示的方式-b a
:空行也会显示出行号,类似(cat -n
)-b t
:空行不会显示出行号(默认值)-n
:列出行号显示的方法-n ln
:行号在自己栏位的左上方显示,且不加 0-n rn
:行号在自己栏位的右上方显示,且不加 0-n rz
:行号在自己栏位的左上方显示,且加 0-w {n}
行号占用的位数
实例
列出文件
a.log
的内容,空白行不列出行号nl a.log
同
nl -b t a.log
空白行列出行号
nl -b a a.log
行号自动补 0(补位数按默认)
nl -b a -n rz a.log
行号自动补 0(设定补位数)
nl -b a -n rz -w 3 a.log
The text was updated successfully, but these errors were encountered: