$ nl filename
1 hoge
2 fuga
3 piyo
4 hogehoge
$ ps | nl
1 PID TTY TIME CMD
2 930631 pts/1 00:00:00 bash
3 2077186 pts/1 00:00:00 ps
4 2077188 pts/1 00:00:00 nl
$ nl -b p^A filename
apple
1 Apple
BANANA
2 Allspice
strawberry
$ cat somefile
aaaa
bbbb
cccc
dddc
$ nl somefile | grep cccc
3 cccc