unzip and maintain directory structure of archives

11,694

Solution 1

You want to invoke unzip without the -j.

Solution 2

If you want to maintain the directory structure then you really need to drop the flag that tells unzip to junk the paths.

Share:
11,694

Related videos on Youtube

Ramy
Author by

Ramy

Updated on September 17, 2022

Comments

  • Ramy
    Ramy almost 2 years

    On fedora-13, I tried using:

    unzip -j [nameof.zip]
    

    but this doesn't seem to maintain the folder structure of the original archive. I REALLY need to maintain this structure because the archive is a backup of all my m4a's which are being converted to mp3. If I just convert it as is, then i'll just have a single massive directory full of mp3's, but they won't be in their respective "artist" folder.

    • Guillermo Siliceo Trueba
      Guillermo Siliceo Trueba over 13 years
      I don't want to be downvoted for this, because the solution sounds trolly, what you need to do is: man unzip it will show you the flag you need, good luck.