1. Match by name
find walks the tree from . and keeps files whose name matches the glob *.log.
find . -name "*.log"Typorithm · medium
Step 1 of 8 · intro card
System
find walks a directory tree filtering by -name (glob), -type, and -mtime; -delete removes matches; pipe results to xargs to build command lines, or use -exec cmd {} + to run a command directly on the matches.
find recursively walks a directory tree starting from the path you give it (here .) and tests each entry against filters: -name takes a glob like "*.log", -type f or -type d picks files or directories, and -mtime -7 selects entries modified in the last 7 days.
Actions run on the matches. -delete removes them in place, while -exec cmd {} + runs a command on the matches, substituting {} for the paths and batching many into each call with the trailing +.
Piping find into xargs is the other common pattern: find prints the paths on stdout, and xargs reads them on stdin to assemble command lines — find . -type f | xargs grep "error" greps every file.
-name globs, -type filters files/dirs, -mtime by age.
-delete removes matches; -exec cmd {} + runs a command.
Pipe to xargs to build command lines from the results.
find . -name "*.log"
find . -type f -mtime -7
find . -name "*.tmp" -delete
find . -type f | xargs grep "error"
find . -name "*.js" -exec wc -l {} +Connect each part of the code to the concept before you type.
find walks the tree from . and keeps files whose name matches the glob *.log.
find . -name "*.log"-type f keeps regular files; -mtime -7 keeps ones modified within the last 7 days.
find . -type f -mtime -7-delete removes every matched path — here all *.tmp files under the tree.
find . -name "*.tmp" -deletexargs reads the file list on stdin and builds grep command lines to search each file.
find . -type f | xargs grep "error"-exec runs wc -l on the matches; {} is the placeholder and + batches them into few calls.
find . -name "*.js" -exec wc -l {} +Read the concept map and follow the code breakdown.
Type the implementation, repair mistakes and work through every recall exercise.
Use the final check without hints; revisit weak concepts in short practice sessions.