≡ Menu

Solaris UNIX Case-Insensitive Find File Search

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.

Share this tutorial on:

Like this? Follow us on Twitter OR support us by using Patreon

{ 1 comment… add one }
  • MethoD February 21, 2012, 2:31 am

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

Security: Are you a robot or human?

Leave a Comment

You can use these HTML tags and attributes: <strong> <em> <pre> <code> <a href="" title="">

   Tagged with: , , , , , , , , , ,