In this post, we will see how to find file by name in linux.
You can use “find” command to find file by name.
Find file in the current directory
Here is a simple command to find file “letters.txt” in current directory.
$ find . -name letters.txt
If you want to find a file by name that contains both upper case and lower case then run:
$ find . -iname letters.txt
Find file in the specific directory
1. Find file “letters.txt” in /home directory.
2. Find file “letters.txt” in multiple directories /home and /opt.
3. Find file “letters.txt” in directory /home and remove it
4. Find all files in /opt directory with txt extension
5. Find all hidden files in /home directory and remove it
6. Find all empty files in directory /home
That’s all about how to find file by name in linux
Join Our News Letter – Stay Updated
Subscribe to Awesome Java Content.