GREP COMMANDS
To search the pattern in a particular file- grep "Nagaraju" filename.txt
To search a pattern without case insensitive
- grep -wi "nagaraju" filename.txt
- grep -win -A/B/C 10 "Nagaraju" filename.txt
- grep -win "Nagaraju" ./*
- grep -v "Nagaraju" filename.txt
- grep -vE "pattern1|pattern2" filename.txt
- grep -c "Nagaraju" filename.txt
- grep -w "Nagaraju" filename.txt
- grep -n "Nagaraju" filename.txt
- grep -o "Nagaraju" filename.txt
- grep "^Nagaraju" filename.txt
- grep "Nagaraju$" filename.txt
How to grep multiple
- grep -E "Naga|Raju" filename.txt
No comments:
Post a Comment