Overview
grep runs a regex content search over an image’s persisted root filesystem, powered by ripgrep on the backend. Use it to find where a config key, symbol, or string lives before running commands — it’s instant and free, unlike run("grep ...") which needs a microVM.
Symlinks are never followed, hidden files are searched, .gitignore-style files inside the image are ignored, and binary files (containing a NUL byte) are skipped.
Parameters
Returns
Match Fields
Cost
Free - No VM spawned. Searches directly over the image filesystem.Examples
Find a Config Setting
Scope by File Type
Case-Insensitive Search
Best Practices
- Prefer over
run("grep ...")-grepis instant and free - Narrow with
pathandglob- avoid scanning the whole rootfs when you know roughly where to look patternis a regex, not a literal string - escape special characters if you want an exact match- Combine with
list_files- list a directory first, then grep the files you find interesting
See Also
- list_files - List files and directories without a VM
- read_file - Read a single file’s full contents without a VM
- run - Execute commands (spawns VM), e.g. for tools ripgrep can’t replace