Saturday, April 27, 2024
19
rated 0 times [  19] [ 0]  / answers: 1 / hits: 83482  / 1 Year ago, mon, december 12, 2022, 6:09:18

The following grep



grep -r -e -n coll *


will display



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


I would like to know what line has the following 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) is



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

More From » command-line

 Answers
1

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


[#42209] Wednesday, December 14, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
disdry

Total Points: 133
Total Questions: 128
Total Answers: 109

Location: Greenland
Member since Fri, Jul 31, 2020
4 Years ago
disdry questions
Tue, Apr 11, 23, 11:37, 1 Year ago
Thu, Oct 13, 22, 19:09, 2 Years ago
Fri, Oct 28, 22, 15:06, 2 Years ago
Sat, Feb 25, 23, 11:33, 1 Year ago
;