Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I use a function that looks like this:

  find $1 -name $2 | xargs egrep -nC3 $3 | less
So, say:

  find ./ -name "*.rb" | xargs egrep -nC3 'gsub' | less
You'll get the matching line, three lines before and three lines after, as well as file name and line numbers.


Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

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

Search: