nl writes each FILE to standard output, with line numbers added.
With no FILE, or when FILE is -, it read standard input.
[Example]
~ nl population.txt
1 China
2 India
3 United States
~ nl -s : population.txt
1:China
2:India
3:United States
~ nl -n rz --number-width=4 population.txt
0001 China
0002 India
0003 United States
[Options]
-s : seprator
-n : number format
ln - left justified, no leading zeros
rn - right justified, no leading zeros
rz - right justified, leading zeros
With no FILE, or when FILE is -, it read standard input.
[Example]
~ nl population.txt
1 China
2 India
3 United States
~ nl -s : population.txt
1:China
2:India
3:United States
~ nl -n rz --number-width=4 population.txt
0001 China
0002 India
0003 United States
[Options]
-s : seprator
-n : number format
ln - left justified, no leading zeros
rn - right justified, no leading zeros
rz - right justified, leading zeros