Update cheatsheets

This commit is contained in:
ivuorinen
2025-06-27 00:20:53 +00:00
parent 6771bea4b5
commit 8d4568cb48
12 changed files with 239 additions and 7 deletions

View File

@@ -18,11 +18,11 @@ source: https://github.com/tldr-pages/tldr.git
- Search for a pattern in all files recursively in a directory, showing line numbers of matches, ignoring binary files:
`grep {{[-r|--recursive]}} {{[-n|--line-number]}} {{[-I|--binary-files=without-match]}} "{{search_pattern}}" {{path/to/directory}}`
`grep {{[-rnI|--recursive --line-number --binary-files=without-match]}} "{{search_pattern}}" {{path/to/directory}}`
- Use extended regular expressions (supports `?`, `+`, `{}`, `()`, and `|`), in case-insensitive mode:
`grep {{[-E|--extended-regexp]}} {{[-i|--ignore-case]}} "{{search_pattern}}" {{path/to/file}}`
`grep {{[-Ei|--extended-regexp --ignore-case]}} "{{search_pattern}}" {{path/to/file}}`
- Print 3 lines of [C]ontext around, [B]efore or [A]fter each match:
@@ -30,7 +30,7 @@ source: https://github.com/tldr-pages/tldr.git
- Print file name and line number for each match with color output:
`grep {{[-H|--with-filename]}} {{[-n|--line-number]}} --color=always "{{search_pattern}}" {{path/to/file}}`
`grep {{[-Hn|--with-filename --line-number]}} --color=always "{{search_pattern}}" {{path/to/file}}`
- Search for lines matching a pattern, printing only the matched text: