I need to grep for a string but only within certain files within a directory- eg:
grep -rl mystring "file1.txt file2.txt file3.blah"
what is the correct syntax? I am working in a Linux OS.
Sommaire |
I need to grep for a string but only within certain files within a directory- eg:
grep -rl mystring "file1.txt file2.txt file3.blah"
what is the correct syntax? I am working in a Linux OS.
Drop the quotes around the file names so that they are treated as separate parameters. Also, I don t think you need the -r since you are just specifying files and not folders.
grep mystring file1.txt file2.txt file3.blah
http://ss64.com/bash/grep.html http://ss64.com/bash/grep.html
License : cc by-sa 3.0
http://stackoverflow.com/questions/12389611/grep-a-list-of-specific-files