开源文档分享

NL

Section: 用户命令 (1)
Updated: 2022年9月
查看本页索引 返回目录
 

名称

nl - 给文件编行号  

概述

nl [,选项/]... [,文件列表/]...  

描述

将文件列表中的每一个文件输出到标准输出,并添加行号。

如果没有指定文件,或者指定文件为"-",则从标准输入读取。

必选参数对长短选项同时适用。

-b, --body-numbering=,样式/
use STYLE for numbering body lines
-d, --section-delimiter=,CC/
use CC for logical page delimiters
-f, --footer-numbering=,样式/
use STYLE for numbering footer lines
-h, --header-numbering=,样式/
use STYLE for numbering header lines
-i, --line-increment=,数字/
line number increment at each line
-l, --join-blank-lines=,数字/
将给定“数值”行连续的空行视为一行
-n, --number-format=,格式/
根据指定格式字符串插入行号
-p, --no-renumber
do not reset line numbers for each section
-s, --number-separator=,字符串/
如果可能的话,将指定字符串添加到行号后
-v, --starting-line-number=,数字/
每一节第一行的行号
-w, --number-width=,数字/
为行号留出指定列的宽度
--help
显示此帮助信息并退出
--version
显示版本信息并退出

Default options are: -bt -d'\:' -fn -hn -i1 -l1 -n'rn' -s<TAB> -v1 -w6

CC are two delimiter characters used to construct logical page delimiters; a missing second character implies ':'. As a GNU extension one can specify more than two characters, and also specifying the empty string (-d '') disables section matching.

所指定的“样式”是下列之一:

a
对所有行进行编号
t
只对非空行进行编号
n
不进行编号
pBRE
仅对匹配基本正则表达式 BRE 的行编号

格式字符串可以是下列字符串中的一个:

ln
左对齐,没有前导数字0
rn
右对齐,没有前导数字0
rz
右对齐,用前导数字0填充空白位
 

作者

由 Scott Bartram 和 David MacKenzie 编写。  

报告错误

GNU coreutils 的在线帮助: <https://www.gnu.org/software/coreutils/>
请向 <https://translationproject.org/team/zh_CN.html> 报告翻译错误。  

版权

Copyright © 2022 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
本软件是自由软件:您可以自由修改和重新发布它。在法律允许的范围内,不提供任何保证。  

参见

完整文档请见: <https://www.gnu.org/software/coreutils/nl>
或者在本地使用: info '(coreutils) nl invocation'  
本页面中文版由中文 man 手册页计划提供。
中文 man 手册页计划:https://github.com/man-pages-zh/manpages-zh


 

Index

名称
概述
描述
作者
报告错误
版权
参见

This document was created by man2html, using the manual pages.
Time: 03:15:08 GMT, July 01, 2024