Tools
find
Locate files by name, type, size, owner, and date — then act on them.
Syntax
find <path> <conditions> <actions>General formfind . -name "*.txt"Find .txt files in cwdfind / -name configSearch entire filesystemName & type
-name "*.c"Match by filename pattern-iname "*.C"Case-insensitive name match-type fRegular files-type dDirectories-type lSymbolic links-regex PATTERNFull path regexSize & time
-size +10MLarger than 10 MiB-size -128cSmaller than 128 bytes-newer file.txtNewer than reference file-mtime -1Modified in last 24 hours-mtime +7Modified more than 7 days ago-atime 0Accessed within last 24 hoursOwnership & logic
-user usernameOwned by user-nouserNo valid owner\! -name "*.c"NOT operator\( expr1 -or expr2 \)OR grouping-depth 2At least 3 levels deepActions
-printPrint matching paths (default)-deleteDelete matched files-exec cmd {} \;Run command on each matchExamples
find . -name '*.jpg' -exec rm {} \;Delete all JPEGsfind . -type f -mtime +30Files untouched 30+ daysfind . -size +100MFiles larger than 100 MBfind . -name '*.ts' -not -path '*/node_modules/*'Exclude node_modules