extract multiple files with password

7,425

The method to extract 1 file would be:

unzip -P password file

This is used to mark several files with different extensions: *.{zip,7zip,rar}

So I would start with ...

unzip -P password *.{zip,7zip,rar}

Mind though that this could error out on any of the files not being correct (damaged) or with the wrong password. Also: this is -insecure-: the password is typed in plain sight and someone checking the process list is also capable of seeing it. If that is a concern you should leave the "password" part and type it when asked.

No idea if it will ask for it every time though so you need to confirm this ;)

Share:
7,425

Related videos on Youtube

simple mind
Author by

simple mind

Updated on September 18, 2022

Comments

  • simple mind
    simple mind over 1 year

    I have about 200 files that i zipped long time a go in win. they are zipped with different extensions (zip, 7zip, rar,...) but the password to extract them is the same.

    How do I extract all the files by inputting the password only once?

    • davidbaumann
      davidbaumann over 8 years
      Use find with -exec.
    • simple mind
      simple mind over 8 years
      how do i do that?
  • simple mind
    simple mind over 8 years
    not working, getting errors "caution: filename not matched". What should i do?
  • Hi-Angel
    Hi-Angel almost 8 years
    You missed the part of sentence after the word …zipped…
  • Nimesha Buddhika Peiris
    Nimesha Buddhika Peiris over 6 years
    default unzip, as to Ubuntu 16.04, does not support extracting multiple files. Use something like for zf in *.zip; do unzip -P *** $zf -d dstdir/; done.
  • Nimesha Buddhika Peiris
    Nimesha Buddhika Peiris over 6 years
    Note: -d is recommended when extracting multiple files to avoid mixing extracted files with original archives.