jj file search prints matched lines
Introduced 2026-08-06 · score 0.97
HOW TO USE IT
When searching repository files and reviewing matching content, run `jj file search` with a pattern to print each matching line prefixed by its file path. Add `--name-only` to print only paths containing matches.
jj file search --pattern <PATTERN> [FILESETS...]jj file search --pattern <PATTERN> --name-only [FILESETS...]WHY THIS HELPS
When searching repository files and reviewing matching content, print each matched line with its path.
BEFORE THIS CHANGE
Previously, `jj file search` printed only paths of files containing a match; use `--name-only` for that behavior.
REQUIREMENTS AND LIMITATIONS
- Version: v0.44.0
- --pattern <PATTERN> / -p <PATTERN> (required): Pattern to search for in a single line; defaults to regex syntax. A glob pattern must match the whole line.
- --name-only: Print paths of files containing a match, not matched lines; conflicts with `--line-number`.
- FILESETS...: Restrict the search to files matching these prefixes; without them, search all files.
- --revision <REVSET> / -r <REVSET>: Revision whose files to search; defaults to `@`.
FIRST-PARTY EVIDENCE
- https://github.com/jj-vcs/jj/releases/tag/v0.44.0
- https://github.com/jj-vcs/jj/blob/v0.44.0/cli/src/commands/file/search.rs
Check the installed version and the source before using it. Entry JSON