LoginSignup
5
3

More than 5 years have passed since last update.

gzipコマンドによる解凍処理で"unknown suffix -- ignored"と言われるとき

Posted at

gzipコマンドで-dをつけると圧縮ファイルの解凍処理が実行できるが、適切な拡張子がないとタイトルにあるエラーメッセージが出て失敗する。

$ echo "Hello" > foo
$ gzip foo
$ ls
foo.gz
$ mv foo.gz foo_gz
$ gzip -d foo_gz
gzip: foo_gz: unknown suffix -- ignored

解決方法としては、単純に適切な拡張子を付ければいい。

一括して拡張子を変更する

カレントディレクトリのファイルを全て"filename.gz"にする。

$ find . -type f | xargs -i mv {} {}.gz

まとめて解凍する。

$ find . -type f | xargs gzip -d
5
3
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
5
3