How to Search files with case-insensitive names in Linux

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.

The post How to Search files with case-insensitive names in Linux appeared first on TecAdmin.

command find General Articles search TecAdmin