This commit is contained in:
2026-05-01 23:44:02 +03:00
parent 82f4df6e98
commit 862b8b2fb0

12
linux/grep.md Normal file
View File

@@ -0,0 +1,12 @@
# Useful grep arguments
## Search without case sensitivity
`cat file.txt | grep -i "pattern"`
## Add lines to match pattern
### Before
`cat file.txt | grep -B 3 "pattern"`
### After
`cat file.txt | grep -A 3 "pattern"`
### Both
`cat file.txt | grep -C 3 "pattern"`
## Show line numbers with matches
`cat file.txt | grep -n "pattern"`