Solaris UNIX Case-Insensitive Find File Search

by on February 6, 2009 · 1 comment· LAST UPDATED February 6, 2009

in , ,

I'd like to match all filename like foo.c, FOO.C, fOO.c, Foo.C and so on using find command under UNIX. How do I do a case-insensitive find search under Sun Solaris / OpenSolaris UNIX systems?

GNU find command has -iname option which is like -name, but the match is case insensitive. For example, the patterns fo* and F?? match the file names Foo, FOO, FoO etc.

How do I do a case-insensitive find under Solaris UNIX?

However, -iname option is not part of Sun Solaris UNIX find command. You can try following syntax under Solaris:
find . -print | grep -i "pattern"
find . -type f -print | grep -i "filename" # match files only
find . -type f -print | grep -i "*.c"
find . -type f -print | grep -i "foo.c"
find . -type d -print | grep -i "dirname" # match dirs only
find . -type d -print | grep -i "directory-name"

Another option

You can install GNU/find under Solaris.

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 1 comment… read it below or add one }

1 MethoD February 21, 2012 at 2:31 am

This doesn’t work for me on my Solaris 10.
Following is working:
find / -name ‘your-file.name’

Reply

Leave a Comment

Tagged as: , , , , , , , , , ,

Previous Faq:

Next Faq: