Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have downloaded over 7000 ebooks from Project Gutenburg, but I have an issue. Each book has been placed in its own zip file, and each zip file has been given its own folder. My problem is that I do not want to have to go through each file and unzip them and put the ebooks in one place manually. If I can get the zip files in one place, it will be an easy job to unpack all of them with one command.

So, how do I get my files into one folder, instead of in their own subfolders?

share|improve this question

Assuming that all the directories that contain the zip files have a common parent, you could use find to find all of the zip files then execute unzip on those files specifying the directory to extract the files to:

find /path/under/zip/folders -name "*.zip" -exec unzip {} -d /target/path \;
share|improve this answer

The wildcards approach can quickly get messy if there is more than a single level of nested folders...

I usually perform similar tasks (and most of other file operations) using Midnight Commander. Install it using

sudo apt-get install mc

Then just start it by typing 'mc', navigate to the folder your ebooks are in, hit Esc, then Ctrl-?, enter search criteria, in the result window hit [Panelize]. Now you can select all your zips by pressing * and copy/move them to the directory in another pane by hitting F5 or F6

share|improve this answer

Do you have experience using wildcards? you could do something like

mv common_part_of_folder_name*/*.zip .

where the asterisk symbol basically means "anything". If you only have the gutenberg in your directory, you can just run

mv ./*/*.zip .

to get all the zip files into your current directory. If it's much more complex than that, a Perl or shell script might be the way to go.

share|improve this answer
The OP is not trying to copy the .zip files, but trying to extract them. Therefore, the correct command would involve wildcards and an archive program. – hexafraction Aug 3 '12 at 13:03

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.