Skip to main content
Added more options, for path names.
Source Link
Ned64
  • 9.3k
  • 9
  • 58
  • 94

You could do something like this

find . -type f -iname \*zip -print0 | xargs -0 --max-args=1 --replace unzip {} \*.jpg \*.jpeg

This would look in the current folder and sub-folders for files called "*.zip", then for each one of them, individually (--max-args=1) the command unzip is called, appending \*.jpg \*.jpeg, thereby selecting the files to extract.

(If we select both *.jpeg and *.jpg files and some of these do not exist unzip may warn us about that. This can be safely ignored.) If

If you wish to test what happens first, insert an echo:

find . -type f -iname \*zip -print0 | xargs -0 --max-args=1 --replace echo unzip {} \*.jpg \*.jpeg

If you with to extract all files in the current folder, irrespective of where they are inside the ZIP file, add the -j option to unzip:

find . -type f -iname \*zip -print0 | xargs -0 --max-args=1 --replace unzip -j {} \*.jpg \*.jpeg

You can also add a target folder by using -d foldername after the -j.

You could do something like this

find . -type f -iname \*zip -print0 | xargs -0 --max-args=1 --replace unzip {} \*.jpg \*.jpeg

This would look in the current folder and sub-folders for files called "*.zip", then for each one of them, individually (--max-args=1) the command unzip is called, appending \*.jpg \*.jpeg, thereby selecting the files to extract.

(If we select both *.jpeg and *.jpg files and some of these do not exist unzip may warn us about that. This can be safely ignored.) If you wish to test what happens first, insert an echo:

find . -type f -iname \*zip -print0 | xargs -0 --max-args=1 --replace echo unzip {} \*.jpg \*.jpeg

You could do something like this

find . -type f -iname \*zip -print0 | xargs -0 --max-args=1 --replace unzip {} \*.jpg \*.jpeg

This would look in the current folder and sub-folders for files called "*.zip", then for each one of them, individually (--max-args=1) the command unzip is called, appending \*.jpg \*.jpeg, thereby selecting the files to extract.

(If we select both *.jpeg and *.jpg files and some of these do not exist unzip may warn us about that. This can be safely ignored.)

If you wish to test what happens first, insert an echo:

find . -type f -iname \*zip -print0 | xargs -0 --max-args=1 --replace echo unzip {} \*.jpg \*.jpeg

If you with to extract all files in the current folder, irrespective of where they are inside the ZIP file, add the -j option to unzip:

find . -type f -iname \*zip -print0 | xargs -0 --max-args=1 --replace unzip -j {} \*.jpg \*.jpeg

You can also add a target folder by using -d foldername after the -j.

Added unzip warning info.
Source Link
Ned64
  • 9.3k
  • 9
  • 58
  • 94

You could do something like this

find . -type f -iname \*zip -print0 | xargs -0 --max-args=1 --replace unzip {} \*.jpg \*.jpeg

This would look in the current folder and sub-folders for files called "*.zip", then for each one of them, individually (--max-args=1) the command unzip is called, appending \*.jpg \*.jpeg, thereby selecting the files to extract.

If(If we select both *.jpeg and *.jpg files and some of these do not exist unzip may warn us about that. This can be safely ignored.) If you wish to test what happens first, insert an echo:

find . -type f -iname \*zip -print0 | xargs -0 --max-args=1 --replace echo unzip {} \*.jpg \*.jpeg

You could do something like this

find . -type f -iname \*zip -print0 | xargs -0 --max-args=1 --replace unzip {} \*.jpg \*.jpeg

This would look in the current folder and sub-folders for files called "*.zip", then for each one of them, individually (--max-args=1) the command unzip is called, appending \*.jpg \*.jpeg, thereby selecting the files to extract.

If you wish to test what happens first, insert an echo:

find . -type f -iname \*zip -print0 | xargs -0 --max-args=1 --replace echo unzip {} \*.jpg \*.jpeg

You could do something like this

find . -type f -iname \*zip -print0 | xargs -0 --max-args=1 --replace unzip {} \*.jpg \*.jpeg

This would look in the current folder and sub-folders for files called "*.zip", then for each one of them, individually (--max-args=1) the command unzip is called, appending \*.jpg \*.jpeg, thereby selecting the files to extract.

(If we select both *.jpeg and *.jpg files and some of these do not exist unzip may warn us about that. This can be safely ignored.) If you wish to test what happens first, insert an echo:

find . -type f -iname \*zip -print0 | xargs -0 --max-args=1 --replace echo unzip {} \*.jpg \*.jpeg
Source Link
Ned64
  • 9.3k
  • 9
  • 58
  • 94

You could do something like this

find . -type f -iname \*zip -print0 | xargs -0 --max-args=1 --replace unzip {} \*.jpg \*.jpeg

This would look in the current folder and sub-folders for files called "*.zip", then for each one of them, individually (--max-args=1) the command unzip is called, appending \*.jpg \*.jpeg, thereby selecting the files to extract.

If you wish to test what happens first, insert an echo:

find . -type f -iname \*zip -print0 | xargs -0 --max-args=1 --replace echo unzip {} \*.jpg \*.jpeg