使用法: nl [オプション]... [ファイル]...
指定したそれぞれのファイルに行番号を付け足して, 標準出力に書き込みます.
ファイルの指定が無いか, `-' を指定した場合には, 標準入力を読み込みます.
長いオプションに必須の引数は短いオプションにも必須です.
-b, --body-numbering=STYLE 本文の行番号を STYLE の形式に
-d, --section-delimiter=CC 論理ページの区切り記号に CC を利用
-f, --footer-numbering=STYLE フッタの行番号を STYLE の形式に
-h, --header-numbering=STYLE use STYLE for numbering header lines
-i, --line-increment=NUMBER line number increment at each line
-l, --join-blank-lines=NUMBER group of NUMBER empty lines counted as one
-n, --number-format=FORMAT insert line numbers according to FORMAT
-p, --no-renumber do not reset line numbers at logical pages
-s, --number-separator=STRING add STRING after (possible) line number
-v, --starting-line-number=NUMBER first line number on each logical page
-w, --number-width=NUMBER use NUMBER columns for line numbers
--help この使い方を表示して終了
--version バージョン情報を表示して終了
オプションの指定が無ければ, プログラムは -v1 -i1 -l1 -sTAB -w6 -nrn, -hn,
-bt, -fn として動作します. CC 値は 論理ページの区切り記号を指定するための
2 つの文字です. 2つめの文字が指定されない場合には, 暗黙に : が指定されます.
`\\' を 指定したければ, `\\' を使うようにしてください.
STYLE は, 以下のうちの 1 つを指定します.
a number all lines
t number only nonempty lines
n number no lines
pBRE number only lines that contain a match for the basic regular
expression, BRE
FORMAT is one of:
ln left justified, no leading zeros
rn right justified, no leading zeros
rz right justified, leading zeros
Report nl bugs to bug-coreutils@gnu.org
GNU coreutils home page:
Usage: nl [OPTION]... [FILE]...
Write each FILE to standard output, with line numbers added.
With no FILE, or when FILE is -, read standard input.
Mandatory arguments to long options are mandatory for short options too.
-b, --body-numbering=STYLE use STYLE for numbering body lines
-d, --section-delimiter=CC use CC for separating logical pages
-f, --footer-numbering=STYLE use STYLE for numbering footer lines
-h, --header-numbering=STYLE use STYLE for numbering header lines
-i, --line-increment=NUMBER line number increment at each line
-l, --join-blank-lines=NUMBER group of NUMBER empty lines counted as one
-n, --number-format=FORMAT insert line numbers according to FORMAT
-p, --no-renumber do not reset line numbers at logical pages
-s, --number-separator=STRING add STRING after (possible) line number
-v, --starting-line-number=NUMBER first line number on each logical page
-w, --number-width=NUMBER use NUMBER columns for line numbers
--help display this help and exit
--version output version information and exit
By default, selects -v1 -i1 -l1 -sTAB -w6 -nrn -hn -bt -fn. CC are
two delimiter characters for separating logical pages, a missing
second character implies :. Type \\ for \. STYLE is one of:
a number all lines
t number only nonempty lines
n number no lines
pBRE number only lines that contain a match for the basic regular
expression, BRE
FORMAT is one of:
ln left justified, no leading zeros
rn right justified, no leading zeros
rz right justified, leading zeros
Report nl bugs to bug-coreutils@gnu.org
GNU coreutils home page:
NL(1) NL(1)
名前
nl - 行番号を付けてファイルを出力する
書式
nl [-p] [-b STYLE] [-d CD] [-f STYLE] [-h STYLE] [-i NUMBER] [-l NUM-
BER] [-n FORMAT] [-s STRING] [-v NUMBER] [-w NUMBER] [--body-number-
ing=STYLE] [--footer-numbering=STYLE] [--header-numbering=STYLE]
[--join-blank-lines=NUMBER] [--page-increment=NUMBER] [--no-renumber]
[--number-format=FORMAT] [--number-separator=FORMAT] [--num-
ber-width=NUMBER] [--section-delimiter=CD] [--starting-line-number=NUM-
BER] [FILE...]
nl [--help] [--version]
説明
nl は指定された FILE それぞれを標準出力に書く。その際行番号を一部または
全部の行に追加する。 FILE が一つも与えられないと標準入力から読み込む 。
また FILE が ‘-’ だった場合には、そのファイルには標準入力が用いられる。
nl は入力を論理ページ (logical page) に分解する。デフォルトでは、行番号
は各々の論理ページの先頭で 1 にリセットされる。 nl は入力されたファイル
すべてをまとめてひとつの文書とみなす。したがってファイルの切れ目でも 行
番号や論理ページはリセットされない。
オプション
-b STYLE, --body-numbering=STYLE
各論理ページの本文セクションにおける行の番号付けの方式を選択する
。行に番号がつかないと、カレントの行番号は増加しないが、行番号の
区切る文字は行の前に置かれる。形式は以下の通り。
a 全ての行に番号をふる。
t 空行でない行のみに番号をふる (本文セクションのデフォルト)
n 行番号をふらない (ヘッダ・フッタセクションのデフォルト)
pREGEXP
REGEXP にマッチした行だけに番号をふる。
-d CD, --section-delimiter=CD
セクション区切りとなる二文字を CD にする (デフォルトは ‘e:’)。 C
だ けが与えられた場合は、2 文字めは ‘:’ のままとなる。 (’\’ 等の
メタキャラクタを指定する場合には、シェルの展開から守るためにクォ
ートするか、バックスラッシュを一つ余計に付けるのを忘れないように
。)
-f STYLE, --footer-numbering=STYLE
--body-numbering を見よ。
-h STYLE, --header-numbering=STYLE
--body-numbering を見よ。
-i NUMBER, --page-increment=NUMBER
行番号の増分を NUMBER にする (デフォルトは 1)。
-l NUMBER, --join-blank-lines=NUMBER
NUMBER だけ連続した空行を、番号付けの際に 1 論理行とみなし、最後
の空行にのみ番号を付ける (NUMBER のデフォルトは 1)。空行の連続が
number 以下の場合には、番号付けを行わない。空行とはスペースや タ
ブも含め、文字を全く含まない行のこと。
-n FORMAT, --number-format=FORMAT
行番号の出力フォーマットを指定する (デフォルトは ‘rn’):
ln 左詰めにし、先頭の 0 埋めをしない。
rn 右詰めにし、先頭の 0 埋めをしない。
rz 右詰めにし、先頭は 0 で埋める。
-p, --no-renumber
論理ページの先頭で行番号をリセットしない。
-s STRING, --number-separator=FORMAT
出力ファイルの行番号とテキスト行の間の区切りに STRING を用いる (
デフォルトは
NL(1) User Commands NL(1)
NAME
nl - number lines of files
SYNOPSIS
nl [OPTION]... [FILE]...
DESCRIPTION
Write each FILE to standard output, with line numbers added. With no
FILE, or when FILE is -, read standard input.
Mandatory arguments to long options are mandatory for short options
too.
-b, --body-numbering=STYLE
use STYLE for numbering body lines
-d, --section-delimiter=CC
use CC for separating logical pages
-f, --footer-numbering=STYLE
use STYLE for numbering footer lines
-h, --header-numbering=STYLE
use STYLE for numbering header lines
-i, --line-increment=NUMBER
line number increment at each line
-l, --join-blank-lines=NUMBER
group of NUMBER empty lines counted as one
-n, --number-format=FORMAT
insert line numbers according to FORMAT
-p, --no-renumber
do not reset line numbers at logical pages
-s, --number-separator=STRING
add STRING after (possible) line number
-v, --starting-line-number=NUMBER
first line number on each logical page
-w, --number-width=NUMBER
use NUMBER columns for line numbers
--help display this help and exit
--version
output version information and exit
By default, selects -v1 -i1 -l1 -sTAB -w6 -nrn -hn -bt -fn. CC are two
delimiter characters for separating logical pages, a missing second
character implies :. Type \\ for \. STYLE is one of:
a number all lines
t number only nonempty lines
n number no lines
pBRE number only lines that contain a match for the basic regular
expression, BRE
FORMAT is one of:
ln left justified, no leading zeros
rn right justified, no leading zeros
rz right justified, leading zeros
AUTHOR
Written by Scott Bartram and David MacKenzie.
REPORTING BUGS
Report nl bugs to bug-coreutils@gnu.org
GNU coreutils home page:
Copyright(C) linux-cmd.com All Rights Reserved. Author Takayuki Yukawa