grep -f regexp.txt data.csv
finds lines that are stored in the data.csv
that match the regular expressions that are stored in the file regexp.txt
. grep -f
is the abbreviation for grep --file
. grep -f
is demonstrated in the following simple example. data.csv
, the file in which we want to search for regular expressions: abc;42;foo def ghi;999;bar jkl;18;baz barbarossa;33;qux
regexp.txt
, the file that contains the regular expressions. Each regular expression occupies one line: [[:digit:]]\{3\} ro..a
grep -f regexp.txt data.csv
prints the two lines that match the regular expressions stored in regexp.txt
: def ghi;999;bar barbarossa;33;qux