find Cheatsheet

Top patterns.

Overview

find is the Unix file-tree traversal tool, present on every Unix box. Five primitives carry most operational use: name matching by glob, type filtering, time-based filtering, size filtering, action via -exec or -delete. Fluency turns "where is X" into a specific query within seconds.

The approach

Start broad, narrow down with filters, prefer -print0 | xargs -0 for safe handling of weird filenames, use -exec for one-shot commands and xargs for parallel operations. Five idioms cover most operational use; memorising them moves the team from manual scrolling to confident shell-driven cleanup.

Why this compounds

Each one-liner that lands in muscle memory shortens the next investigation. Find in scripts produces scheduled cleanup; find on the command line produces fast disk-management investigations. By year two, find is the first tool reached for any file-system question.