Use find when you need an exact, current answer, because it walks the directory tree live. It can match on a file's name and type. It can also match on size and permissions, and act on each match by deleting it or running a command.
Sizes round up to whole units, so -size -1k matches only empty files. Use -size -1024c for files under 1024 bytes.
# Find by name
find /path -name "filename"
find . -name "*.txt"
# Find by type
find /home -type f # Files only
find /home -type d # Directories only
# Find by size
find /var -size +100M # Files larger than 100MB
find . -size -1024c # Files smaller than 1KB
# Find by permissions
find . -perm 755
find . -perm -u+x # Files executable by owner
# Find and execute action
find /tmp -name "*.tmp" -delete
find . -name "*.log" -exec rm {} \;
Use locate when speed matters. It searches a database of file names instead of the disk, so it misses files created since updatedb last ran.
locate filename
updatedb # Update locate database
For programs, which shows the first matching executable in PATH, and whereis also finds its source and manual pages.
which python # Find executable in PATH
whereis python # Find binary, source, manual
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
The diagram below the answer is the concept . Jump to it ↓