linux

Zip a folder in Linux

So today when I was taking backup of files without using cPanel, I tried my hands at creating a zip archive using SSH Prompt.

But I was stuck, because when I used the comand,

zip files-backup.zip *

It compressed all the files in the directory, but all the contents of the folders were not included in the zip archive at all.

So I checked around the web and found that,

The command for compressing a folder and creating a zip archive, in Linux is :

zip -9 -r folder-backup.zip blog

Where folder-backup.zip is the name of the newly created archive file,

blog is the name of the folder I wanted to compress.

I downloaded the file using FTP client, but if you place it in your public_html folder then you can download it directly from web browser, by using the URL

http://www.your-site-name.com/folder-backup.zip

Hope this proves to be useful for others searching for the same.

Leave a Reply

Your email address will not be published. Required fields are marked *