Update cheatsheets

This commit is contained in:
ivuorinen
2024-02-21 11:19:49 +00:00
parent 4e88a1b42f
commit 3d653cc7e6
4803 changed files with 127002 additions and 0 deletions

34
fgrep Normal file
View File

@@ -0,0 +1,34 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# fgrep
> Matches fixed strings in files.
> Equivalent to `grep -F`.
> More information: <https://www.gnu.org/software/grep/manual/grep.html>.
- Search for an exact string in a file:
`fgrep {{search_string}} {{path/to/file}}`
- Search only lines that match entirely in one or more files:
`fgrep -x {{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}}`
- Show the line number in the file along with the line matched:
`fgrep -n {{search_string}} {{path/to/file}}`
- Display all lines except those that contain the search string:
`fgrep -v {{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 ...}}`