Skip to content

How to Search files with case-insensitive names in Linux

Category
Linux
On this page

find is the basic Unix command used to search files recursively under a directory tree. It is default available in all the Linux operating systems.

All the Linux command line users must be aware about uses of Linux find command. It The find command traverse under a directory tree and capable to search files or directory based on defined search pattern. It also provides option to search files with names in uppercase or lowercase or mixed case.

In this tutorial you will learn about how to search files with case insensitive names.

Find files with Case Insensitive Names

Use -name command line option followed by the file name under a directory tree. The below command will search all files with name backup.zip under the current directory and sub directories.

find . –name backup.zip 

The above command searches files in case sensitive names.

Use -iname option to search file names in any case. Here iname means insensitive names. The following command will match all patter like Backup.zip, BACKUP.ZIP, backup.Zip or BackUp.Zip etc.

find . –iname backup.zip 

The case insensitive means any letter of a file name cane be uppercase or lowercase. In this situation use find with option -iname to search all files matching files in any case.

Conclusion

In this quick tutorial, you have learned to find files with case insensitive names in Linux.

Rahul

Rahul Kumar is the founder and chief editor of TecAdmin.net. A Red Hat Certified Engineer (RHCE), he has worked in IT since 2009, with hands-on experience in Linux system administration, DevOps, web hosting, cloud platforms and automation. He started TecAdmin in 2013 to share practical, step-by-step guides, and leads its editorial work with one aim: making technical learning clear and useful for sysadmins, developers and beginners alike.

Leave a Reply

Your email address will not be published. Required fields are marked *


Back to top