- Bump ctx API to 1.31.0; extend /proc/bare_os/syscalls.json schema 4 (fdModel, signalModel) - Add /mirror/aux* routing for auxiliary Hyperdrives; optional BLAKE2b-keyed /bin cache (BARE_OS_VFS_BIN_CACHE_BLAKE2B) - Wire seeder snapshotHintsJson from BARE_OS_SEED_* env; add seeder unit tests - Shell: trap -p; docs for jobs/bg/trap; sync schemas, examples, compatibility matrix, handbook ch.9 - Coreutils: Issue 7 man option rows for cp/mv/ln/find/grep/sed/awk/tar/test/true; xcu-issue7-sweep tests - Docs: env appendix, vault-threat-model, node-vs-bare-host-matrix, test:bare, CHANGELOG 1.31.0
109 lines
2.3 KiB
JSON
109 lines
2.3 KiB
JSON
{
|
|
"name": "grep",
|
|
"section": 1,
|
|
"title": "pattern matching utility",
|
|
"synopsis": [
|
|
"grep [-E|-F] [-i] [-v] [-n] [-c] [-l] [-q] [-s] [-H|-h] [-e pat] ... [-f file] ... [pattern] [file...]"
|
|
],
|
|
"description": "Searches input or files for lines matching a pattern. Uses JavaScript RegExp unless -F (fixed string). Not bit-identical to GNU grep.",
|
|
"bareOsNotes": "POSIX Issue 7 option names are listed below; regex semantics follow JavaScript RegExp unless -F.",
|
|
"options": [
|
|
{
|
|
"flag": "-E",
|
|
"meaning": "Extended regex (accepted; patterns use JS RegExp)"
|
|
},
|
|
{
|
|
"flag": "-F",
|
|
"meaning": "Fixed string match"
|
|
},
|
|
{
|
|
"flag": "-i",
|
|
"meaning": "Ignore case"
|
|
},
|
|
{
|
|
"flag": "-v",
|
|
"meaning": "Invert match"
|
|
},
|
|
{
|
|
"flag": "-n",
|
|
"meaning": "Prefix lines with line number"
|
|
},
|
|
{
|
|
"flag": "-c",
|
|
"meaning": "Count matching lines only"
|
|
},
|
|
{
|
|
"flag": "-l",
|
|
"meaning": "List files with matches"
|
|
},
|
|
{
|
|
"flag": "-q",
|
|
"meaning": "Quiet (exit status only)"
|
|
},
|
|
{
|
|
"flag": "-s",
|
|
"meaning": "Suppress error messages"
|
|
},
|
|
{
|
|
"flag": "-H / -h",
|
|
"meaning": "Force / suppress filename prefix"
|
|
},
|
|
{
|
|
"flag": "-e pat",
|
|
"meaning": "Specify pattern"
|
|
},
|
|
{
|
|
"flag": "-f file",
|
|
"meaning": "Read patterns from file"
|
|
}
|
|
],
|
|
"keywords": [
|
|
"grep",
|
|
"search",
|
|
"regex",
|
|
"pattern",
|
|
"filter"
|
|
],
|
|
"seeAlso": [
|
|
{
|
|
"name": "sed",
|
|
"section": 1
|
|
},
|
|
{
|
|
"name": "awk",
|
|
"section": 1
|
|
}
|
|
],
|
|
"bareOsNotes": "UTF-16 strings and JS regex differ from strict POSIX/GNU.",
|
|
"examples": [
|
|
{
|
|
"caption": "recursive feel (grep each file)",
|
|
"code": "grep -n error *.log"
|
|
},
|
|
{
|
|
"caption": "case insensitive",
|
|
"code": "grep -i todo NOTES.md"
|
|
},
|
|
{
|
|
"caption": "invert (lines without)",
|
|
"code": "grep -v '^#' config"
|
|
},
|
|
{
|
|
"caption": "fixed string (no regex)",
|
|
"code": "grep -F \"v1.0\" CHANGES"
|
|
},
|
|
{
|
|
"caption": "count matches",
|
|
"code": "grep -c FAIL build.log"
|
|
},
|
|
{
|
|
"caption": "only filenames",
|
|
"code": "grep -l main *.js"
|
|
},
|
|
{
|
|
"caption": "multiple patterns",
|
|
"code": "grep -e foo -e bar file.txt"
|
|
}
|
|
]
|
|
}
|