jgrep requirement doc

jgrep is obsolete, I use silver searcher now

  1. default with color

like “grep –color”

  1. jgrep a single file

counterpart cmd:
grep -rn “verity” fs_mgr/fs_mgr.c
cmd:
jgrep “verity” fs_mgr/fs_mgr.c
jgrep “verity” -f fs_mgr/fs_mgr.c
options:
-f: specify a file[default]

out:
44:#include “fs_mgr_priv_verity.h”
401: if (fs_mgr_setup_verity(&fstab->recs[i]) < 0) {
532: if (fs_mgr_setup_verity(&fstab->recs[i]) < 0) {

  1. jgrep a single file with groups

options:
-r: show groups

cmd:
jgrep -g “(veri)(ty)” fs_mgr/fs_mgr.c

out:
401:[33,39) if (fs_mgr_setup_verity(&fstab->recs[i]) < verity_kk) {
[0]veri
[1]ty
401:[44,55) if (fs_mgr_setup_verity(&fstab->recs[i]) < verity_kk) {
[0]veri
[1]ty
532:[22,33) if (fs_mgr_setup_verity(&fstab->recs[i]) < 0) {
[0]veri
[1]ty

  1. jgrep from stdin

cmd:
jgrep “(veri)(ty)” -
“input some text”
“input some text”

<LINE_END>
  1. jgrep recursively

options:
-r

cmd:
jgrep “verity” -r fs_mgr/

out:
fs_mgr/fs_mgr_verity.c:420: if (resume_verity_table(io, mount_point, fd) < 0) {
fs_mgr/fs_mgr_verity.c:424: // assign the new verity block device as the block device
fs_mgr/fs_mgr_verity.c:426: fstab->blk_device = verity_blk_name;
fs_mgr/fs_mgr.c:44:#include “fs_mgr_priv_verity.h”
fs_mgr/fs_mgr.c:401: if (fs_mgr_setup_verity(&fstab->recs[i]) < 0) {

  1. jgrep ignore-case option

options:
-i: ignore case