Fixup grammar in grep cheatsheet

This commit is contained in:
Shadab Zafar 2015-06-19 23:16:06 +05:30
parent 402d15e8d8
commit 97dd037538
1 changed files with 5 additions and 5 deletions

View File

@ -1,13 +1,13 @@
# Basic:
# Search a file for a pattern
grep pattern file
# case nonsensitive research:
grep -i pattern file
# Case insensitive search (with line numbers)
grep -in pattern file
# Recursively grep for string <pattern> in 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
# Find lines NOT containing pattern
@ -17,7 +17,7 @@ grep -v pattern file
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
# 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"
grep -rnw 'directory' -e "pattern"