--jobs
- Accepted by
opengrep scan,opengrep ci- Also spelled
-j- Value
INT- Default
the number of cores detected- See also
--max-memory,--timeout,--optimizations,--incremental-output,--time
By default, Opengrep runs as many parallel workers as there are cores. --jobs N sets the number of workers.
Each worker analyzes its own files, and the limit of --max-memory applies to each worker separately, so fewer workers use less memory in total. With --jobs 1, log messages do not interleave.
The findings do not depend on the number of workers.
Examples
Scanning with one worker
rule.yaml
rules: - id: find-eval pattern: eval(...) message: found eval languages: [python] severity: WARNINGapp.py
eval(1)Command and result
$ opengrep scan -q --config rule.yaml --jobs 1 app.py
app.py
warn find-eval
found eval
1: eval(1)