grep -e foo -e bar *.txt
With a more complete context:
for file in $(ls aaa.txt bbb.txt)
do
echo ""
echo $file
echo "======================="
cat $file | grep -e "^foo" -e "^bar"
done
http://unix.stackexchange.com/questions/37313/how-do-i-grep-for-multiple-patterns
No comments:
Post a Comment