Files and shell

Zip and unzip files

Pack a folder into a .zip (or .tar.gz) and unpack it again.

Fill these in once
  1. Zip a folder
    Terminal
    zip -r my-folder.zip my-folder
  2. Unzip into a new folder
    Terminal
    unzip my-folder.zip -d unzipped
  3. Or make and open a .tar.gz
    Terminal
    tar -czf my-folder.tar.gz my-folder
    tar -xzf my-folder.tar.gz
  1. Install zip and unzip if they're missingNeeds sudo
    Terminal · Ubuntu / Debian
    sudo apt install -y zip unzip
  2. Zip a folder
    Terminal · Ubuntu / Debian
    zip -r my-folder.zip my-folder
  3. Unzip into a new folder
    Terminal · Ubuntu / Debian
    unzip my-folder.zip -d unzipped
  4. Or make and open a .tar.gz
    Terminal · Ubuntu / Debian
    tar -czf my-folder.tar.gz my-folder
    tar -xzf my-folder.tar.gz
  1. Zip a folder
    PowerShell
    Compress-Archive -Path my-folder -DestinationPath my-folder.zip
  2. Unzip into a new folder
    PowerShell
    Expand-Archive -Path my-folder.zip -DestinationPath unzipped
  3. Or make and open a .tar.gz (tar comes with Windows)
    PowerShell
    tar -czf my-folder.tar.gz my-folder
    tar -xzf my-folder.tar.gz