You need to use the following command to search for a file called FileName.txt under the current folder including all subfolders
find . -name FileName.txt
If you are unclear about the file name or want to match a part of the file name, you can use a wildcard pattern:
find . -name “FileName*”
To Search only directories excluding all files:
find . -type d
If you would like to filter only files modified for the last 4 days, you can use:
find . -mtime -4
Searching word or textual content in folder, file or directory with its sub-folders you can use ‘grep’ command for the same.
E.g. want to find word “Images”
grep “Images” configuration.php
If you don’t know which file contains the text, you can use:
grep -r -l “Images” *
-r = It will look recursively.
-H = It will gives the result in human readable format.
“Images” * = For the string “Images” in all (*) files under the current folder.
To only list the file names comprising the string you’re looking but leave out the line containing it, you can use the -l command:
grep -l “Images” *