bash-findLast updated Sep 20, 2023 Edit SourceBash# Resources:GeeksforGeeks# Syntax:1 2 3 4 5 6 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:DescriptionSyntaxSearch for all files of a patternfind ./GFG -name *.txtPlaceholder 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 }To run defined functions with find -exec, you need to specify the shell (since only shell can run shell scripts)).