Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can't quite figure out how to do this right. I have a folder with a website in /var/www

I want to create a zip file with all of it, which when I decompress it does not include the top directory. In other words, the "top" of the zip file should not be the www directory, but the files inside that directory. Hope that made sense...

Reason why I need it is because I need to upload my website as a zip file and then unzip it in place. And won't work if it then unzips to webroot/www/ instead of webroot/.

Any able to help with how to do this correctly in the terminal?

share|improve this question
Which commands and arguments are you using to make the Zip? – Ƭᴇcʜιᴇ007 Oct 3 '11 at 18:40
up vote 2 down vote accepted
cd /path/to/your/folder/www
zip -r *


mv /some/other/path
share|improve this answer
Will this include hidden files? – Svish Oct 3 '11 at 19:33
* does include hidden files. – Joshua Robinson Apr 11 at 8:10

7z a -tzip -w /var/www/.

Hidden files included.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .