mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-03-06 13:56:52 +00:00
Update cheatsheets
This commit is contained in:
10
tldr/fgrep
10
tldr/fgrep
@@ -15,20 +15,20 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Search only lines that match entirely in one or more files:
|
||||
|
||||
`fgrep -x {{search_string}} {{path/to/file1 path/to/file2 ...}}`
|
||||
`fgrep {{[-x|--line-regexp]}} {{search_string}} {{path/to/file1 path/to/file2 ...}}`
|
||||
|
||||
- Count the number of lines that match the given string in a file:
|
||||
|
||||
`fgrep -c {{search_string}} {{path/to/file}}`
|
||||
`fgrep {{[-c|--count]}} {{search_string}} {{path/to/file}}`
|
||||
|
||||
- Show the line number in the file along with the line matched:
|
||||
|
||||
`fgrep -n {{search_string}} {{path/to/file}}`
|
||||
`fgrep {{[-n|--line-number]}} {{search_string}} {{path/to/file}}`
|
||||
|
||||
- Display all lines except those that contain the search string:
|
||||
|
||||
`fgrep -v {{search_string}} {{path/to/file}}`
|
||||
`fgrep {{[-v|--invert-match]}} {{search_string}} {{path/to/file}}`
|
||||
|
||||
- Display filenames whose content matches the search string at least once:
|
||||
|
||||
`fgrep -l {{search_string}} {{path/to/file1 path/to/file2 ...}}`
|
||||
`fgrep {{[-l|--files-with-matches]}} {{search_string}} {{path/to/file1 path/to/file2 ...}}`
|
||||
|
||||
Reference in New Issue
Block a user