1

is there a grep switch or totally other app that reads a file of criterias to filter in or out?

view story
linux-howto

http://unix.stackexchange.com – Assuming file a.txt has: 1a 2b 3c 4d so grep "1" a.txt would return: 1a and grep "3" a.txt would return: 3c what if i want to put a criteria file named crit.txt with the following content: 1 3 is there a switch in grep say -cf for criteria file where i could do grep -cf crit.txt a.txt that would return: 1a 3c or is there other tool that does the same thing, and provide me with an example on how to use the tool. The tool should be a one liner command. (HowTos)