Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

the fallowing grep

grep -r -e -n coll *

will display

fullpath/filename:  <tag-name>coll</tag-name>

I would like to know what line has the fallowing text, I tried adding -n, but it did not work. I tried adding | grep -n *, but it did something weird.

what I would like to see (I don't care about format)

fullpath/filename:10:  <tag-name>coll</tag-name>
share|improve this question
    
I see line numbers when using the -n option. Can you post the output of what you get? –  Kris Harper Nov 8 '11 at 15:58
add comment

1 Answer

up vote 9 down vote accepted

You should put -e at the end of the options list: grep -rne coll *

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.