「grep」コマンドを使います。
http://homepage2.nifty.com/cs/linux_command/command/grep.html
上記を参照してね。
ありがとうございました。
助かりました。