Find every log file below the current directory
Build a paste-ready command, then review its compatibility and effects before running it.
find . -type f -name '*.log' -printread-onlyno known side effects Compatibility
Linux + macOSVerified for Linux, macOS using posix, bash, zsh syntax.
Operational knowledgereview due 2027-01-19
Requirementsfindfind must be installed and available on PATH.
Version supportfind Current supported releasesVerified for linux, macos using posix, bash, zsh syntax; consult compatibility notes for platform-specific differences.
Expected signals./logs/app.logRepresentative successful output; values vary with the selected target and system state.
Known errorsfind: command not foundfind is missing or is not available on PATH.
Verifyfind . -type f -name '*.log' -printThe output matches the expected target and exits without an error.Rollback noteNot required: this command is read-only and does not change system state.
Command breakdown
01find .Search from hereWalks the current directory and its descendants.
02-type fFiles onlyExcludes directories and other filesystem objects.
03-name "*.log"Name patternMatches filenames ending in .log; quoting prevents the shell from expanding the wildcard first.
04-printPrint matchesWrites every matching path to standard output.
Example input
find . -type f -name "*.log" -print
Example output
./logs/app.log
./logs/worker.log
./archive/2026-07-22.log
Illustrative output — exact values vary by system and data.
Official sources