Skip to main content
Search file contents in a container image using ripgrep, without spawning a VM.

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

Best Practices

  • Prefer over run("grep ...") - grep is instant and free
  • Narrow with path and glob - avoid scanning the whole rootfs when you know roughly where to look
  • pattern is 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