linux: Unzip in own dir

Robert9

Well-known member
On windows i choose five zips, left-click, unzip in own directory, finished.
How can I do this under Linux?

After 100 years working with XF I have found out that uploading the zips and unzip on linux is much more faster than unzip in windows and upload.
Very funny. I have tears in my eyes when i think about how many thousands of hours i could be in holiday instead uploading unzipped add-ons.
 
I'm certainly no expert, so I don't know if this is standard, but on my server I just use unzip filename.zip. That unzips all the add-on files into a folder called "upload". Then I use cp -rf upload/* public_html/ to copy the files into my web directory. Then go to the admin panel and upgrade.
 
Next time I will unzip all needed add-ons in windows and then zip them all to one file, upload it, and unzip it manually.
This should be the fastest way, as long I dont know it better.

To unzip one file, i can do very easy with MC. The problem is how to unzip all selected files, and here MC seems not to work with zip.
 
Hi,

here's a little bash script that might do what you want.

Bash:
#!/bin/bash

for ZIPFILE in *.zip; do
    FOLDERNAME=${ZIPFILE//".zip"/}

    mkdir -p $FOLDERNAME
    unzip $ZIPFILE -d $FOLDERNAME
done;

Here's the same again as a one-liner to just paste into the terminal (where your zip files are):
Bash:
for X in *.zip;do;Y=${X//".zip"/};mkdir -p $Y;unzip $X -d $Y;done;

I haven't tested it, so best use it in a safe folder first. ;)
 
Top Bottom