Search for files in a directory hierarchy.

Synopsis

find [path...] [expression]

Description

Search for files and directories matching specified criteria within a directory tree. If no path is given, searches the current directory. Runs in the just-bash WASM shell inside SLICC, operating on a virtual filesystem backed by IndexedDB.

Options

-name PATTERN File name matches shell glob PATTERN.

-iname PATTERN Like -name but case insensitive.

-type TYPE File is of type: f (regular file) or d (directory).

-empty File is empty or directory has no entries.

-maxdepth LEVELS Descend at most LEVELS directories.

-exec CMD {} ; Execute CMD for each matched file.

-print Print the full file name (default action).

-delete Delete matched files and directories.

--help Display help and exit.

Examples

$ find . -name "*.js" -type f

Find all JavaScript files.

$ find /home -type d -empty

Find all empty directories.

$ find . -name "*.log" -delete

Delete all log files.

$ find src -name "*.ts" -exec grep -l "TODO" {} +

Find TypeScript files containing TODO.

Notes

Operates on the SLICC virtual filesystem (LightningFS/IndexedDB). Supports complex boolean expressions with parentheses. Performance is optimized with batch processing and early pruning for large directory trees.

See Also

ls, grep, xargs, tree