Issue
I'm in a directory and I have a zip containing files and directories. I need to unzip that file, into current directory, but preserving the file structure.
unzip myfile.zip will create a myfile directory in current directory which is not what I want.
unzip -j myfile.zip will kill all the file strucure, which is not what I want.
Solution
unzip myfile.zip
extracts files in the working directory by keeping path names from the zip file.
So if you get a subdirectory myfile
it means it is part of the relative path of compressed files. Check it by listing the zip content
unzip -l myfile.zip
So you can unzip the file from the directory above, or, from the target directory unzip with -d
option, where -d is the directory above
cd myfile
unzip myfile.zip -d ..
Answered By - gile