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.

Is there a compression utility that will allow extracting a file while skipping the first (container) directory.

My purpose is to create an automated install script that will download a specific .zip, extract and install. I want option to skip the container directory which is nearly always an undesirable name.

An example would be like using the rar option ep1

rar x -ep1 archive.rar
share|improve this question
    
You want to skip a directory? Or you just don't want the top-level directory within the archive created on extraction? –  Flimzy Jul 3 '11 at 1:25

1 Answer 1

You could try p7zip, the Unix command line port of the popular archiving tool 7-zip. It may have the feature you are asking for, but I don't know what the command would exactly be.

If I understand correctly you could always try extracting the archive then doing:

cd archivename
mv * ..
rm -f archivename

This should move all the files from within the folder in to the directory above then delete the original containing folder.

share|improve this answer

Your Answer

 
discard

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.