Update cheatsheets

This commit is contained in:
ivuorinen
2025-12-13 00:20:51 +00:00
parent 2c1898f6e4
commit 489b2e0e99
106 changed files with 322 additions and 306 deletions

View File

@@ -5,29 +5,8 @@ source: https://github.com/tldr-pages/tldr.git
---
# egrep
> Find patterns in files using extended `regex` (supports `?`, `+`, `{}`, `()`, and `|`).
> More information: <https://manned.org/egrep>.
> This command is an alias of `grep --extended-regexp`.
- Search for a pattern within a file:
- View documentation for the original command:
`egrep "{{search_pattern}}" {{path/to/file}}`
- Search for a pattern within multiple files:
`egrep "{{search_pattern}}" {{path/to/file1 path/to/file2 ...}}`
- Search `stdin` for a pattern:
`cat {{path/to/file}} | egrep {{search_pattern}}`
- Print file name and line number for each match:
`egrep {{[-H|--with-filename]}} {{[-n|--line-number]}} "{{search_pattern}}" {{path/to/file}}`
- Search for a pattern in all files recursively in a directory, ignoring binary files:
`egrep {{[-r|--recursive]}} --binary-files={{without-match}} "{{search_pattern}}" {{path/to/directory}}`
- Search for lines that do not match a pattern:
`egrep {{[-v|--invert-match]}} "{{search_pattern}}" {{path/to/file}}`
`tldr grep`