nl
nl linux command cheatsheet by Thamizhiniyan C S
Last updated
nl linux command cheatsheet by Thamizhiniyan C S
Last updated
Values | Description |
---|---|
Flags | Description |
---|---|
Command | Description |
---|---|
-b STYLE
Used for numbering body lines
-i NUMBER
Line number increment at each line
-n FORMAT
Insert line numbers according to FORMAT
-v NUMBER
Change first line number of the given input
-l NUMBER
Group of NUMBER empty lines are counted as one
-s STRING
Add any STRING after every logical line number
-w NUMBER
Use different NUMBER columns for line numbers
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
ln
Left justified, no leading zeros
rn
Right justified, no leading zeros
rz
Right justified, leading zeros
To display a file with line numbers (Numbers all non-empty lines)
To number all lines (including empty lines also)
Count multiple, consecutive, non-empty lines as one
Override default increment
To make the starting line number different
Add a string literal after line numbers
Change column for line numbers
To number all logical lines that match the specified REGEX (number those lines that begin with F)
To print the lines using left-justified, no leading zeros number format
To print the lines using right-justified, no leading zeros number format
To print the lines using right-justified with leading zeros format