私はsolarisで.tar.gz形式のファイルを持っています。私はそれからいくつかの行をgrepしたい。私はzipgrepコマンドを使用していますが、行を見つけることができません。以下は、私が使用しているサンプルファイルとコマンドです。Solarisの.tar.gzファイルでgrepしたい
サンプルファイル:
BD201701.tar.gz
BD201702.tar.gz
BD201703.tar.gz
私はバングラデシュを含む行を検索するためのコマンドの下に使用しています。
zipgrep 'bangladesh' BD2017*
ただし、以下のエラーが表示されます。
[BD201701.tar.gz]
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
zipinfo: cannot find zipfile directory in one of BD201701.tar.gz or
BD201701.tar.gz.zip, and cannot find BD201701.tar.gz.ZIP, period.
/usr/bin/zipgrep: test: argument expected
'.tar.gz'ありません' .zip'、と 'zipgrep 'は' tar.gz 'を明らかにサポートしていません。 –
ファイルから行を探すコマンドを教えてください。 – bKashOST
'tar'を使ってファイルを展開し、' cat'で内容を表示してから 'grep'を使います。 –