Skip to content

Instantly share code, notes, and snippets.

@stevedoyle
Last active June 26, 2024 09:37
Show Gist options
  • Save stevedoyle/536a5279fb3fd8d7f1c1bfd1815ef64b to your computer and use it in GitHub Desktop.
Save stevedoyle/536a5279fb3fd8d7f1c1bfd1815ef64b to your computer and use it in GitHub Desktop.
Ripgrep Cheatsheet
# Search only within a single file
rg <pattern> <filename>
rg <pattern> -g <filename pattern>
rg <pattern> --glob <filename pattern>
# Use ripgrep to extract unique 4 digit numbers from a file
`rg -o '\b\d{4}\b' <file_name> | sort -u`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment