zipを7zipに再パッケージする方法は?

zipを7zipに再パッケージする方法は?

zipアーカイブを7zipアーカイブに安全かつ迅速に再パッケージする方法は?

7zipプログラムオプションを確認しましたが、再梱包オプションは表示されませんでした。ディレクトリに解凍してディレクトリをパッケージ化できることを知っていますが、安全ですか? ZIPファイルに「../../file.exe」や「/etc/bin/file.exe」などのパスがある場合はどうなりますか?

ファイルを解凍して標準出力で試しましたが、7zipプログラムはそうすることができますが、名前などではないファイルの内容だけを出力します。したがって、この出力を取得して7zipアーカイブにパッケージ化する別の場所にリダイレクトすることはできません。

ベストアンサー1

arepackatoolツールバーからこのツールを簡単に使用することもできます。通常、または経由yum install atoolapt-get install atoolインストールされます。利用可能になると、簡単に次のことができます。

$ arepack -e -F 7z *.zip

これにより、すべての.zipファイルが.7zファイルに変換されます。それでも*.zipファイルを削除する必要がありますが、次のように簡単に実行できます。

$ rm -f *.zip

追加のアーカイブオプション

Options:
  -e, --each               execute command above for each file specified
  -F, --format=EXT         override archive format (see below)
  -O, --format-option=OPT  give specific options to the archiver
  -D, --subdir             always create subdirectory when extracting
  -f, --force              allow overwriting of local files
  -q, --quiet              decrease verbosity level by one
  -v, --verbose            increase verbosity level by one
  -V, --verbosity=LEVEL    specify verbosity (0, 1 or 2)
  -p, --page               send output through pager
  -0, --null               filenames from standard in are null-byte separated
  -E, --explain            explain what is being done by atool
  -S, --simulate           simulation mode - no filesystem changes are made
  -o, --option=KEY=VALUE   override a configuration option
      --config=FILE        load configuration defaults from file

Archive format (for --format) may be specified either as a
file extension ("tar.gz") or as "tar+gzip".

おすすめ記事