Jump to content

Help Need An Archive Manager Or Cli Unzipper


Recommended Posts

Posted

i have about 6000 zip files i need to unzip but must

ignore any paths stored in the archive and unzip into the current directory

ignore any errors in the zip file and skip it

i could do this in winrar but file roller which comes with ubuntu is no good and the unzip command does not seem powerful enough - please correct me if i am wrong

anyone have any suggestions

many thanks

PastEgo

Posted

You're looking for the 'unzip' command. The "-j" option will move all the files into the root directory.

I'd suggest doing a

 unzip -j *.zip ~/Desktop/zip

Note that I can't see a way to avoid it choking on errors, but it will tell you the problems and you can remove the offending files.

Posted

great the problem is that a large number of files have nested sub directories within which i dont want i just want the file itself that is stored in there

will the -j do that

thanks again

PastEgo

Posted
great the problem is that a large number of files have nested sub directories within which i dont want i just want the file itself that is stored in there

will the -j do that

thanks again

PastEgo

from the unzip manual page

		[-x xfile(s)]
		   An  optional  list of archive members to be excluded from processing.  Since wildcard charac‐
		   ters normally match ('/') directory separators (for exceptions see the option -W, this option
		   may be used to exclude any files that are in subdirectories.  For example, ''unzip foo *.[ch]
		   -x */*'' would extract all C source files in the main directory, but none in any  subdirecto‐
		   ries.   Without the -x option, all C source files in all directories within the zipfile would
		   be extracted.

so I would expect that

 unzip filename.zip -x */*

would do the trick.

If your zip files are in multiple directories as well you could say

 find . -type f -name \*.zip -print -exec unzip {} -x "*/*" \;

to find all .zip files starting from current directory and unzip all of them to the current directory. Only files in the root directory inside of the zip files will be extracted.

HTH :)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.


  • Topics

  • Latest posts...

    1. 86

      COVID Vaccines Could INTEGRATE with Human DNA: Yale Research

    2. 14

      Thailand Live Monday 23 December 2024

    3. 0

      Driver Escapes After Car Crashes into Canal in Bang Kuntian

    4. 21

      Less-Refined Farang: Are Farang in Asia now less refined than before?

    5. 20

      Drunken Foreigner Causes Panic in Pattaya, Wandering Half Naked & Armed with a Knife

    6. 14

      Thailand Live Monday 23 December 2024

    7. 0

      21-Year-Old Sets Fire to Rental Units in Buriram After Consuming Drugs, Destroying 6 Units

  • Popular in The Pub


×
×
  • Create New...