【Linux】指定したファイル内の文字列を検索するコマンド

$ grep "[検索したい文字列]" < [検索したいファイル名]
  • test.txtから"xxx"という文字列を検索する場合
$ grep "xxx" < test.txt