Search only in file type
Limit recursive search to .py files only
grep -r --include='*.py' 'import os' /srv/app/
More grep commands
-
grep -r --exclude-dir='.git' --exclude-dir='node_modules' 'TODO' .Search recursively skipping vcs and dependency dirs
-
grep -rn 'panic:' /var/log/app/Show file and line number for each match
-
rg 'TODO|FIXME|HACK' --type py -lList files containing TODO/FIXME/HACK in Python files
-
rg 'panic' -C3 --glob '*.go'3 lines of context around matches in Go files
-
rg 'secret_key' --hidden --no-ignoreSearch hidden and .gitignore'd files