Command line and power tools
The difference between rm *.log doing what you meant and doing something memorable is understanding one fact: the shell, not the command, expands the pattern — before the command ever runs.
When you type ls *.pdf, zsh replaces *.pdf with the actual matching filenames and *then* runs ls. Seeing the expansion is one keystroke away — type the pattern and press Tab, or preview safely:
echo *.pdf
echo is the dry run for any glob: it prints exactly what the destructive command would receive.
| Pattern | Matches |
|---|---|
*.pdf | any .pdf in this folder |
report-?.pdf | one single character |
*.[jp]*g | .jpg, .jpeg, .png-ish sets |
**/*.pdf | recursive, all subfolders |
is the one worth installing into your fingers: ls /*.sketch finds every Sketch file below here, no find command required. It works in default macOS zsh; bash needs shopt -s globstar.
Hidden files are excluded. * skips dotfiles by design — cp * /backup silently leaves .env behind. Match them deliberately with .* or zsh's *(D).
No match is an error in zsh. A pattern matching nothing aborts the command (zsh: no matches found) — safer than bash, which passes the literal *.pdf to the program as text, producing the classic confusing failure inside the command instead.
Spaces are fine, quoting is not. A *quoted* glob is literal: rm "*.log" tries to delete one file named asterisk-dot-log. Quote filenames, never patterns.
Globs are for the current situation — quick, visual, interactive. The find command is for conditions globs cannot express (size, age, type) and for scripts, where its explicitness is a feature. The practical split: glob until the question involves *when* or *how big*, then reach for find.
zsh treats a non-matching pattern as an error rather than passing it through. The pattern is wrong for this folder — echo it to see, or check hidden-file and case issues.
The pattern: /*.pdf expands recursively in zsh. It replaces a whole class of simple find invocations.
Everywhere keeps track of every file on your Mac — including the folders Spotlight hides and drives you have unplugged. Free for a day, then $19 once.
Download for MacVersion 2.15.7 · macOS 13+ · 3.8 MB · notarised