Given a nested directory, I would like to list all tif files with extension .tif
, .TIF
, .tiff
, .TIFF
.
Currently I'm using
find . -type f -iname *.TIF -print ; find . -type f -iname *.TIFF -print;
Using -iname
allows me to be case-insensitive but it goes through the directory twice to get files with .tif
and .tiff
. Is there a better way to do this? Perhaps with brace expansion?
Why not *.tif*
?
In some cases, my directories might have auxiliary files with extension .tif.aux.xml
alongside the tiffs. I'd like to ignore those.
ren *.tiff *.tif
first ? :-) (hint: don't)find
? If you're usingzsh
(which supports recursive**
in a glob) for instance,echo **/*.{tif,tiff,TIF,TIFF}
should be enough.find
has (which OP may need; not sure).