Extract ZIP files in Linux

6 Sep, 2007  |  Posted by Danesh  |  in Linux

ZIP archives are most commonly used in Windows/MS-DOS based environments.

In Linux, you can use the “unzip” command to extract,list or test ZIP files. Below are the common tasks I use “unzip” for.

Extract the contents of a ZIP file into it’s own directory and also create subdirectories as needed.

# unzip [filename].zip

Extract the contents of a ZIP file into the current directory only. No subdirectories will be created.

# unzip -j [filename].zip

Extract the contents of a ZIp file into a custom directory.

# unzip -d [target directory] [filename].zip

List the contents of a ZIP file.

# unzip -l [filename].zip

Test the integrity of a ZIP file and it’s contents.

 # unzip -t [filename].zip

# unzip -tq [filename].zip (Only shows summary)

Extract the contents of a ZIP file only if the files already exist in the target directory. Good for upgrades.

# unzip -f [filename].zip

# unzip -fo [filename].zip (non interactive. Yes to all)

Extract the contents of a ZIP file if the contents are newer then what’s available in the target directory or don’t exist yet. Good for upgrades.

# unzip -u [filename].zip

# unzip -uo [filename].zip (non interactive. Yes to all)

Did this help? If you need further information please drop me a comment.

  • Digg
  • del.icio.us
  • BlinkList
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • Furl
  • Google
  • Live
  • Facebook
  • Pownce
  • TwitThis
  • E-mail this story to a friend!
  • LinkedIn
  • Ping.fm
Tags: ,

One Response so far | Have Your Say!

  1. PFWD : blog.peterfisher.me.uk : Unzip comand example :  |  November 7th, 2008 at 5:47 am #

    [...] article from thedaneshproject.com explains each of the flags in detail [...]

    PFWD : blog.peterfisher.me.uk : Unzip comand example : - Gravatar

Leave a Feedback

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>