Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
特定のテキストを含む行のみを末尾に表示するにはどうすればよいですか? 検索条件を正規表現にできれば、なおさらです。次のようなものが必要です:
tail -f mylogfile.log showOnlyLinesWith "error: "
私は Darwin (Mac OS X) を実行していますが、bash の初心者です。
できるよ
tail -f mylogfile.log | grep "error: "
これは正規表現でも機能します。一般に、任意のコマンドの出力を取得し、|それを「パイプ」して grep に追加し、grep で特定のパターンに一致しない行を除外できます。
|