Is there any ZIP tools that do similar to the patch -p1 command, where the first N directory names would get ignored?

My users send me ZIP files that often contain one unnecessary directory, and instead of unzipping them in place, I have to unzip, then go into the subdirectory and move all the files out. Sometimes it's a zip of thousands of files, and that extra move step can take a while. If 7z or something had 7z x -p1 my_zip.zip, that first directory could be ignored. I'd still want to have the directory tree inside that subdirectory.


Not finding anything built-in to do the work, I created https://github.com/tgmayfield/zip-dir-strip

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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