Im trying to extract the contents of a zip file but I want to extract it to my own directory.
I'v tried -d
from unzip but that just puts the contents of the zip into that directory.
But I want to extract the contents of the first (root) directory in the zip if there is only one directory in the root of the zip else just extract the files/folders in the root of the zip file (if there are more then one files).
e.g.
test.zip
contents the following dir structure:
test.zip
\
/app_v1/ <-The contents of this directory I want extracted to a dir of my choice
\
- folder-1
- folder-2
- folder-3
- folder-4
- file1
- file2