[Shell command] zip でディレクトリをまとめて圧縮する

作成日: 2026年10月04日

zip コマンドの -r オプションを使用すると、ディレクトリ内のファイルとサブディレクトリをまとめて ZIP ファイルに圧縮できます。

zip -r archive.zip sample

この例では、sample ディレクトリ以下を archive.zip に圧縮します。

Shell command