PDA

View Full Version : [ubuntu] Search by file type



prezbedard
February 25th, 2010, 06:16 PM
Is it at all possible to search for files by "type" in Ubuntu? I am using Ubuntu 8.04LTS for the record. I often search for particular file types that may have different extensions images for example. There doesn't seem to be any way of tweaking the search tool to do that though.

Thanks!

Kakers
February 25th, 2010, 06:32 PM
In terminal type

locate *.<filetpye>

Example: locate *.jpg
will locate all jpg files.

prezbedard
February 25th, 2010, 07:16 PM
In terminal type

locate *.<filetpye>

Example: locate *.jpg
will locate all jpg files.

Yes I know how to search by file extension but what about a general image search so it will search for jpgs, pngs, gifs etc. without having to perform separate searches.

Kakers
February 25th, 2010, 08:36 PM
Like?


locate *.jpg *.png *.txt *.mp3

kealan
September 14th, 2010, 07:01 PM
Actually, prezbedard has a valid (and still unanswered) question. Using the suggested method, to find (most of) the image files on a hard drive one could have to type:

locate *.bmp *.gif *.jpg *.png *.psd *.thm *.tif *.yuv *.nef *.2bp *.abm *.adc *.afx *.agif *.agp *.apng *.art *.arw *.awd *.blkrt *.bm2 *.can *.cd5 *.cin *.cit *.cpt *.dib *.dt2 *.fpx *.gbr *.gih *.gim *.hdp *.jas *.jbr *.jng *.kodak *.msp *.orf *.odi *.pbm *.pcd *.psp *.psd *.raf *.wb1 *.yuv

asmoore82
September 14th, 2010, 11:51 PM
Not the most efficient thing in the world =D ...


find <some_dir> -type f -exec file '{}' ';' | grep -i image