Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2011
    Posts
    1

    Exclamation Unanswered: Unzip the same file multiple times command

    Hello,

    I have a folder which has files of the following format,

    test.zip.zip.zip.zip.zip.zip.zip

    There are like 110 files of the format.

    Is there any command to unzip a file and then unzip the result from the previous step and unzip again until whole is unzipped to test.txt

    Please advise.

  2. #2
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    You could search for all zip files in the directory, unzip the first one and move it away to some other directory. Then start from the beginning and run this loop as long as you find a .zip file.
    Code:
    while [ -n "`ls *.zip`" ]; do
        for i in *.zip; do
            unzip $i
            mv $i elsewhere/
        done
    done
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •