Ok i need to extract a zip archive named 'example.zip' but i would like to extract it as a different file name, not 'example' being my folder name, how could i extract a zip archive using unzip called 'example.zip' and extract it as the folder name 'examplefold'
By default,
unzip
extracts the content of the archive directly into the current directory.You can specify a different target directory where to extract the files using the
-d
option:Or if the archive itself contains a folder
example
which you want to extract to the current directory, but with a different name, you must manually rename it toexamplefold
afterwards:Assume that you have some zip files with these names:
Also, in each zip file there is a folder which is called
tmp
. I will write a bash file (say zz.sh) with this content:Then run the file by: