Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

2 Answers 2

up vote 1 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

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

Hidden files included.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.