Posted by: spitfire June 8, 2007
Login in to Rate this Post:
0
?
One way to search multiple strings with grep is by using a list of those strings in separate text file.
cat > pattern.txt
string 1
string 2
Now you can use it as " grep -f pattern.txt input_file.txt | ..."
Also, in some version of wc it will print the input file name after the line count.
You may do:
wc -l input_file.txt | awk '{ print $1 }'