grep -n

Show line numbers with each match

grep -n prefixes each match with its line number. Use when you need to jump to the exact line in a file editor.

Example

$ grep -n 'listen' /etc/nginx/nginx.conf
36:  listen 80;
41:  listen 443 ssl;
Tip: Type it yourself in the terminal below - reading is not the same as doing.