Resources:

Syntax:

 
find [where to start searching from]
 [expression determines what to find] [-options] [what to find]
 
e.g 
find "$MD_DIRECTORY" -name '*.md' -exec echo "File is: {}" \;
  • By default, find searches recursively to include sub-directories and files too.

Cheatsheet:

DescriptionSyntax
Search for all files of a patternfind ./GFG -name *.txt
Placeholder for “current file path of found object” → {}find "$MD_DIRECTORY" -name '*.md' -exec echo "File is: {}" \;
To run a command after finding a file, use -execfind [location] -exec \;
To initiate a loop on a $pattern file, without splitting the lines into fieldswhile IFS= read -r pattern; do { code here }