i used "grep -f patterns.txt phrases.txt" as a part of linux Find command. But the result is the phrasses not file names/file paths which is what i need.. i need to search millions of files and 20 phrasses in each of the file that match Find parameters... this is end of my Find command: -exec grep -f my_phrasses.txt {} \; any idea how to return file pathes, not phrasses from my_phrasses.txt while maintaining low memory, cpu impact of the command? thx
Do you mean, you want to find a phrase in millions of files and you want the path to its files listed?
yes, pathes to files which contains at least one phrasse from my_phrasses.txt i cant use grep alone as i have several parameters to linux "Find" that helps reduce amount of files that will be grepped
Your looking for the "-H" option in grep. You can also use the "-l" option to print just the filenames instead of the matches.