Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Possible Duplicate: Create an archive from a directory without the directory name being added to the archive

I have a folder that I want to zip completely:

MyFolder
       |
       |--- SubFolder1
       |--- SubFolder2
       |--- file1
       |--- file2

I want to zip everyting into myzip.7z, but I don't want 'MyFolder' to be inside the archive:

myzip.7z
       |
       |--- SubFolder1
       |--- SubFolder2
       |--- file1
       |--- file2

instead of

myzip.7z
       |
       |--- MyFolder
                   |
                   |--- SubFolder1
                   |--- SubFolder2
                   |--- file1
                   |--- file2

How do I do that?

share|improve this question

marked as duplicate by afrazier, Ben Richards, Sathya May 2 '12 at 7:12

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer 1

This is how I did it.

cd MyFolder
7z a -r ../myzip *

This creates the archive (myzip.7z) in the parent of MyFolder rather than in MyFolder directly.

Alternatively (without first changing into MyFolder):

7z a myzip ./MyFolder/*
share|improve this answer

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