Print file name and line number
Show the file and line number for each match
grep -rn 'panic:' /var/log/app/
- tool
- grep15 commands
More grep commands
-
rg 'TODO|FIXME|HACK' --type py -lList Python files that contain TODO, FIXME or HACK
-
rg 'panic' -C3 --glob '*.go'Show 3 lines of context around matches in Go files
-
rg 'secret_key' --hidden --no-ignoreAlso search hidden files and files ignored by .gitignore
-
rg 'old_value' --replace 'new_value' --passthru config.yamlShow the whole file with the replacement applied, without writing to it
-
rg 'error' /var/log/ --stats 2>&1 | tail -5Show the number of matches, searched files and elapsed time