cmd

Adding line numbers to a file

$ cat -b /etc/inittab
     1  root:x:0:root
     2  bin:x:1:root,bin,daemon
     3  daemon:x:2:root,bin,daemon
     4  sys:x:3:root,bin,adm
     5  adm:x:4:root,adm,daemon
     6  tty:x:5:
     7  disk:x:6:root
     8  lp:x:7:daemon,lp
     9  mem:x:8:
    10  kmem:x:9:
    11  wheel:x:10:root
    12  mail:x:12:mail
    13  news:x:13:news
    14  uucp:x:14:uucp
    15  man:x:15:
    [...]

Adds line numbers to all non blank lines from the specified file.

speak up

Add your comment below, or trackback from your own site.

Subscribe to these comments.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*Required Fields