Finding things cheat sheet
The most useful finding things commands on one printable page, every line checked by running it.
find Walk a directory tree and print, or act on, every file that matches a set of tests.
find . -name '*.py'- Find files by name output
find . -type d echo --- find . -type l- List only directories, or only files output
find . -type f -mtime -4 | sort- Find recently modified files output
find . -name '*.py' -exec grep -n TODO {} +- Run a command on all results at once with -exec {} + output
find . -maxdepth 1 -name '*.txt' -print0 | xargs -0 wc -l- Pipe names safely to xargs with -print0 output
whereis Locate the binary, source and manual page files for a command in the standard system directories.
which Show which executable file in PATH would run for a command name.
xargs Read items from standard input and run a command with them as arguments, in batches or in parallel.
printf '%s\n' web01 web02 db01 | xargs echo ping- Turn lines into arguments output
xargs -n 2 < data/hosts.txt- Limit the number of arguments per command with -n output
cut -d' ' -f1 data/hosts.txt | xargs -I{} echo "checking {} on port 22"- Put the item in the middle of the command with -I output
printf '%s\0' *.txt | xargs -0 wc -l- Handle any file name with -0 output
time (seq 4 | xargs -P 4 -I{} sh -c 'sleep 1; echo "job {} done"')- Run commands in parallel with -P output
From https://opscape.vip/cheatsheets/search/ · checked 2026-10-31