Hacker News new | past | comments | ask | show | jobs | submit login

grep -H "# TODO" file1 dir1/* file2

Is also useful, as it prints the filename and the matching lines.

if you are using GNU grep, -H option gets enabled by default when there are multiple input files

Hopefully only when stdout isatty().

Edit: Nope, writes l̶i̶n̶e̶ ̶n̶u̶m̶b̶e̶r̶s̶ file names to output regardless. Boo.

you mean filename, not line numbers?

option -h will disable filename in output

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact