mirror of
https://github.com/Erreur32/cheat.git
synced 2024-12-22 13:42:11 +01:00
Fixup grammar in grep cheatsheet
This commit is contained in:
parent
402d15e8d8
commit
97dd037538
1 changed files with 5 additions and 5 deletions
|
@ -1,13 +1,13 @@
|
||||||
# Basic:
|
# Search a file for a pattern
|
||||||
grep pattern file
|
grep pattern file
|
||||||
|
|
||||||
# case nonsensitive research:
|
# Case insensitive search (with line numbers)
|
||||||
grep -i pattern file
|
grep -in pattern file
|
||||||
|
|
||||||
# Recursively grep for string <pattern> in folder:
|
# Recursively grep for string <pattern> in folder:
|
||||||
grep -R pattern folder
|
grep -R pattern folder
|
||||||
|
|
||||||
# Getting pattern from file (one by line):
|
# Read search patterns from a file (one per line)
|
||||||
grep -f pattern_file file
|
grep -f pattern_file file
|
||||||
|
|
||||||
# Find lines NOT containing pattern
|
# Find lines NOT containing pattern
|
||||||
|
@ -17,7 +17,7 @@ grep -v pattern file
|
||||||
grep "^00" file #Match lines starting with 00
|
grep "^00" file #Match lines starting with 00
|
||||||
grep -E "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" file #Find IP add
|
grep -E "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" file #Find IP add
|
||||||
|
|
||||||
# Find all files who contain {pattern} in the directory {directory}.
|
# Find all files which match {pattern} in {directory}
|
||||||
# This will show: "file:line my research"
|
# This will show: "file:line my research"
|
||||||
grep -rnw 'directory' -e "pattern"
|
grep -rnw 'directory' -e "pattern"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue