Day 33 - Grep: line number

09 May 2017

Grep argument of the day => -n.

It displays results with line number.

Example:

$ cat /etc/passwd | grep -n /bin/bash
1:root:x:0:0:root:/root:/bin/bash
28:samber:x:1000:1000::/home/samber:/bin/bash