LoginSignup
2
2

More than 5 years have passed since last update.

tar.gz ファイルから直接grep取り出し

Posted at

tar.gz されてるファイルから 直接grepして抽出する

tar.gzに圧縮されているファイルから特定の文字列(を含む)列を別ファイルに書き出す。
大量の過去ログからこのデータだけ!ってときに便利

  • hoge.tar.gz というファイルから「taro」と書かれた行を grep_taro.txt というファイルに書き出す
tar zxOf hoge.tar.gz | grep taro > grep_taro.txt
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2