find
Find files and folders by name, type and more
What it does
find walks a folder with all its subfolders and prints the paths that match your conditions. The first argument says where to look (. is the current folder), the conditions follow.
-name matches by name, patterns included: -name "*.log". Quote the pattern, or the shell expands * before find ever sees it. -type f keeps only files, -type d only folders.
Syntax
find <folder> -name "<pattern>"
find <folder> -type d -name <name>Examples
Find every .log file in the current folder and below
find . -name "*.log"same as:
find . -name '*.log'find— search for files.— start from the current folder-name "*.log"— by name; quotes keep the shell from expanding *
Find every node_modules folder in the project
find . -type d -name node_modulessame as:
find . -name node_modules -type d-type d— folders only-name node_modules— with this name