WordPress Help

Compress folders in SSH

When you want to compress large folders or if you don't have access to a file manager, you'll need to use a Secure Shell (SSH) connection to create compressed files.

Required: You'll need an SSH app to complete these steps. We suggest PuTTY for Windows, or Terminal for macOS.
  1. Connect to your hosting account with SSH.
  2. Use the command ls to list files and folders, and cd and ../ to move through directories until you are in the directory above the one you want to compress. For example, if you want to compress the wp-content folder located in the public_html folder, you should be in the public_html folder.
  3. Use one of the following commands depending on the type of compression you want:
    • To create a .tar.gz file enter:
      tar -czvf filename.tar.gz /foldername
    • To create a .zip file enter:
      zip –r filename.zip /foldername
    In the commands above, you should replace filename with name you want to use for the compressed file and foldername with the name of the folder you want to compress.
  4. Select Enter on your keyboard.

Your folder is now compressed, and you can download the file to your local computer or transfer it to another location.

More info

Share this article