How to zip a Directory using SSH with htaccess files included
The easiest way to backup, migrate or move a lot of files at once, is to assemble them in one package, and zip them using SSH, then download the zip file, or use wget to transfer it on another server (Will talk about wget in my next post).
Once logged in using SSH, browse the directory you want to zip, using the cd command, for example:
Then to zip the entire directory and files recursively, we use:
To zip all the directories and files with htaccess included, use the following command:
To unzip the filename that we already zipped, simply use the below command:
Moving or downloading files from a server, can take a lot of time. By zipping all the files and downloading the .zip file, the required download time can be greatly reduced and eventually the files will be received faster.