batch unzip
Hi,
I'm trying to extract a whole bunch of zips with one command... Maybe a collection of flags for "tar"? I cant seem to get it to work.. CHeers H |
ls -1 *zip | xargs -xl unzip
Cheers, Tink |
Why wouldn't it just work to pipe it to unzip - why must it be xarg'ed?
|
Quote:
My unzip comes back with a usage message. Cheers, Tink |
I'm getting a usage message using the xargs version..
Unzip is trying to process these lines... -rwxrwxr-x 1 root users 2993146 2004-09-08 07:50 ma551l02.zip -rwxrwxr-x 1 root users 2993599 2004-09-08 07:53 ma551l03.zip -rwxrwxr-x 1 root users 2994002 2004-09-08 07:55 ma551l04.zip -rwxrwxr-x 1 root users 2993146 2004-09-08 07:57 ma551l05.zip -rwxrwxr-x 1 root users 2993144 2004-09-08 07:59 ma551l06.zip -rwxrwxr-x 1 root users 2993146 2004-09-08 08:01 ma551l07.zip shouldnt it be... ma551l02.zip ma551l03.zip ma551l04.zip ma551l05.zip ma551l06.zip ma551l07.zip help? Cheers H |
I think the unzip arguments should be in uppercase. unzip -XL
You could create a quick loop in bash to unzip each file. for zipfile in *.tar do unzip -XL "${zipfile}" done If you want to type it on one line: for zipfile in *.tar; do unzip -XL "${zipfile}"; done With bash, you can enter it in interactively as I did in the first version. The prompt will become '>' to let you know that you need to continue. About your last question about including more zip files in the command line, additional files on the command line are taken as the particular files to extract from the zip archive rather than extracting them all. About the unzip options, -X preserves the original owner and permission settings for linux files. -L converts names to lower case if the original files were saved on a FAT32 or similar filesystem where the filenames are uppercase. The double quotes around the variable zipfile are needed in case the file name contains a whitespace or special character. |
Quote:
|
Quote:
People should use copy & paste :} Cheers, Tink |
ah. didnt know about that "-1" flag....
Cheers H |
Quote:
close to 30 years :}) Linux keeps you on your toes! :) Cheers, Tink |
All times are GMT -5. The time now is 07:45 AM. |