Lucas
Lucas

Reputation: 3

unzip sub directories into one directory

I have one directory with many sub directories 1,2 and more levels deep with zip files.

Could you help me with command to unpack all the zip files in the subdirectories into one directory named /set/ ?

I am on Ubuntu

Upvotes: 0

Views: 101

Answers (1)

M. Becerra
M. Becerra

Reputation: 659

Use this from the parent directory to extratc all zip file to /set:

find . -name "*.zip" -print | xargs -I{} unzip -o {} -d /path/to/set

If you want no subdirectories in /set, you can use this from /set parent directory:

find . -mindepth 1 -type f  -print0 | xargs -I{} mv {} /path/to/set

Upvotes: 1

Related Questions