Using cat command to number nonempty output lines

-b, –number-nonblank
number nonempty output lines

root@dell:/etc# cat -b inittab
1 # /etc/inittab: init(8) configuration.
2 # $Id: inittab,v 1.91 2002/01/25 13:35:21 miquels Exp $

3 # The default runlevel.
4 id:2:initdefault:

-n, –number
number all output lines

root@dell:/etc# cat -n inittab
1 # /etc/inittab: init(8) configuration.
2 # $Id: inittab,v 1.91 2002/01/25 13:35:21 miquels Exp $
3
4 # The default runlevel.
5 id:2:initdefault:

Trackback URI | Comments RSS

Leave a Reply

You must be logged in to post a comment.