Real-World Code Search Recipes

High-value ripgrep recipes for refactors, security scans, framework audits, logs, and docs.

View
StandardDetailedCompact
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all
## Refactor recipes
Find debug logging in source code
rg -t ts -t tsx 'console\.log\(' src/

# Locate `console.log` usage across a codebase.

Find deprecated API calls
rg -t py -t js '\boldApi\(' .

# Search for an old method across target languages.

Find a React hook across TSX files
rg -t tsx '\buseEffect\b' app/

# Search only the frontend component surface.

Find `SELECT *` usage
rg -i 'select\s+\*' .

# Audit SQL anti-patterns in code or migrations.

Find hard-coded URLs
rg -P 'https?://\S+' .

# Search for HTTP(S) URLs in source and config.

## Security and secrets hygiene
Search for AWS access key patterns
rg -P 'AKIA[0-9A-Z]{16}' .

# Look for common credential shapes.

Find private key headers
rg 'BEGIN (RSA |EC |OPENSSH )?PRIVATE KEY' .

# Detect committed key material.

Find password-like env names
rg -i 'password|secret|token|api[_-]?key' .env*

# Search environment files for suspicious keys.

Find JWT-like tokens
rg -P '[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+' .

# Search for three-part dot-separated JWT structures.

Find SSH key references
rg -i 'id_rsa|id_ed25519|IdentityFile' .

# Inspect code and config for private key usage.

## Logs, docs, and ops recipes
Search for 5xx errors in logs
rg '\b5\d\d\b|Internal Server Error|Exception' logs/

# Find common server-side error lines.

Find container image references
rg -t yaml 'image:\s' deploy/ charts/

# Search YAML and Helm files for image tags.

Find Terraform resource blocks
rg -t tf '^resource\s+"aws_' infra/

# Search infrastructure code for a resource type.

Find OpenAPI operation IDs
rg -t yaml -t json '^\s*operationId:' api/

# Search specs for operation identifiers.

Recommended next

No recommendations yet.