Anyone able to help me with this -lirn arg.
-n should give me the line number, but it isnt? I am using ZSH, but i tried with regular bash but it gives me same output?
It appears to be a pretty simple reason: the "-l" command will cause grep to print only the filename of a file that matches. It appears to have a higher priority than th "-n" command.
...also, using both "-l" and "-n" doesn't make much sense to me. "-l" says to only print the filename and print it only once, even if there are multiple matches in a file. If the phrase you're looking for is in the file three times, how would grep even display the matching line numbers?
I'm guessing you maybe copied this from somewhere and are wondering why it isn't working the same way... in which case, are you sure it's supposed to be -l (lowercase L) and not -I (uppercase i)? -I makes sense with -r because it causes grep to skip files that look like they contain binary data.
#3 hmm i didnt copied it from anywhere.. But you gave me the correct answer.. thank you