Find Case Insensitive Search with Linux Find Command
![Find Case Insensitive Search with Linux Find Command](https://storage.googleapis.com/static.configserverfirewall.com/images/linux/find-case-insensitive-search.webp)
There is an option we could provide the find
command with if we want to ignore case in the find search result.
The option is -iname
, which searches for the filename using a case insensitive search.
find [starting-point] -iname [expression]
Examples: Using -iname to run a case-insensitive search
Run a case-insensitive search to find files named readme in Linux root filesystem (/
):
find / -iname readme
The following command performs a case-insensitive search in the /etc
directory to find filenames that start with gpg-key:
find /etc -iname gpg-key*
![find case insensitive](https://storage.googleapis.com/static.configserverfirewall.com/images/linux/run-a-case-insensitive-search.webp)
Ignore case and find files and folders that contain network anywhere in the file or folder name:
find /etc -iname *network*
![Ignore case and find files and folders that contain network](https://storage.googleapis.com/static.configserverfirewall.com/images/linux/find-iname.webp)