[Gllug] find by mime type

Neil Chambers neilcuk at aol.com
Tue Jun 29 14:20:50 UTC 2004



Bruce Richardson wrote:

>Find doesn't do mime types.  Find's parameters check against simpler
>properties like filename or the various properties (last modified,
>permissions, owner) that are stored in a file's inode.  The "file"
>utility, on the other hand, can examine a file and give a mime type if
>you pass it the -i parameter.  However, file doesn't do recursive
>searches, so you need to use file and find together.  Something like
>
>    find /path/to/search | xargs file -i | grep text/html
>
>replacing 'text/html' with whatever you're looking for.
> 
>
>  
>
aha - now that makes sense. Thanks Bruce!
n

-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list