Linux/Unix: Find Command Ignore Case Insensitive Search

In Linux/Unix, you can perform a case-insensitive search using the find command by using the -iname option. The -iname option allows you to match file names case-insensitively.

Here’s an example of how to use find to search for files with a certain extension (e.g. .txt) in the current directory and all its subdirectories, ignoring case sensitivity:

find . -iname "*.txt"

This will search the current directory (.) and all its subdirectories for files whose names end with .txt, ignoring case sensitivity. The results will be displayed on the console.

You can also use the -iname option with other find options to perform more complex searches. For example, to find files that have a certain word in their names and are larger than a certain size, you could use the following command:

find . -iname "*word*" -size +100k -print

This will search for files whose names contain the word “word” and are larger than 100 kilobytes, ignoring case sensitivity, and print the results.

Leave a Comment