Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List all graphic image files with find? [closed]

There are many types of graphic images in this huge archive such as .jpg, .gif, .png, etc. I don't know all the types. Is there a way with 'find' to be able to have it list all the graphic images regardless of their dot extension name? Thanks!

like image 666
Edward Avatar asked May 26 '13 09:05

Edward


People also ask

How do I find my photo files?

Scroll down the Start menu and click on File Explorer. Within File Explorer click on This PC in the left pane. Now, type kind:=picture into the Search box in the top-right of the window. Windows will automatically search all partitions on your hard drive.

How do I view a png file in Linux?

Nomacs is another popular tool you can use to view PNG images in Linux. It is free, open-source, and supports all major image formats. To view a PNG image with nomacs, launch the tool. Then, in the top menu, select Open and navigate to the image location.


1 Answers

This should do the trick

find . -name '*' -exec file {} \; | grep -o -P '^.+: \w+ image' 

example output:

./navigation/doc/Sphärische_Trigonometrie-Dateien/bfc9bd9372f650fd158992cf5948debe.png: PNG image ./navigation/doc/Sphärische_Trigonometrie-Dateien/6564ce3c5b95ded313b84fa918b32776.png: PNG image ./navigation/doc/subr_1.jpe: JPEG image ./navigation/doc/Astroanalytisch-Dateien/Gamma.gif: GIF image ./navigation/doc/Astroanalytisch-Dateien/deltaS.jpg: JPEG image ./navigation/doc/Astroanalytisch-Dateien/GammaBau.jpg: JPEG image 
like image 142
j.holetzeck Avatar answered Sep 18 '22 16:09

j.holetzeck