Count files below the current directory
Build a paste-ready command, then review its compatibility and effects before running it.
find . -type f | wc -lread-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 signals184Representative 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 | wc -lThe 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
01findCommandRuns the find stage of this one-liner.
02.ArgumentPasses . to find.
03-typeOptionConfigures find with the -type option.
04fArgumentPasses f to find.
05|PipelinePasses the output on the left to the command on the right.
06wcCommandRuns the wc stage of this one-liner.
07-lOptionConfigures wc with the -l option.
Example input
find . -type f | wc -l
Illustrative output — exact values vary by system and data.
Official sources