Skip to main content

In Linux. using SSH, you can zip an entire directory and it’s contents quickly using the following command:

zip -r mydir

Example – You’d like to zip up a directory located at:


Login via ssh and navigate one level up:

cd /var/www/html

From here just run the zip command:

zip -r sitename

There are several reasons this can come in handy:

  • You don’t have GUI access to the server and downloading individual files could be very time consuming via FTP client
  • You need to take a quick backup
  • You do have GUI access to the server, but the utility for zipping up the files there may not be efficient depending on your tool

Leave a Reply