filmov
tv
Learn GREP From Basic To Advance Under 5 minutes!

Показать описание
/Description/
Hey Everyone, In this video I have told you about "Grep" tool. It is used to search text files with help of specific pattern. Here are some basic as well as advance commands for Grep Tool.
- install Grep
sudo apt install grep
- Basic Syntax
grep "searched Term" "filename"
- Ignoring case-sensitive
grep -i "search term" filename
- Search recursively
grep -r "search term" directory name
- Count lines
grep -c "search term" filename
- Print line number
grep -n "search term" filename
- More than One word
grep "word1\|word2" filename
- Print name of file
grep -l "word" *
- Specific word
grep -w "word" filename
- Display matched word only
grep -o 'word' filename
- Start with specific word
grep ^word filename
- End with specific word
grep word$ filename
- Print n lines before results( where n = Natural Numbers )
grep -B n "word" filename
- Print n lines after results
grep -A n "word" filename
-Print n line both before and after results
grep -C n "word" filename
- Lines starting with alphanumeric characters
grep ^[[:alnum:]] filename
Similarly for Alphabets: alpha
For digits: digit
For HexaDecimal: xdigit
For Tabs and Spaces: space
For punctuation: punct
Reference Links;
My Socials;
INSTAGRAM: @z1l_0x
DISCORD: @z1l0x
Tags;
#grep #linux #commands #tools
Hey Everyone, In this video I have told you about "Grep" tool. It is used to search text files with help of specific pattern. Here are some basic as well as advance commands for Grep Tool.
- install Grep
sudo apt install grep
- Basic Syntax
grep "searched Term" "filename"
- Ignoring case-sensitive
grep -i "search term" filename
- Search recursively
grep -r "search term" directory name
- Count lines
grep -c "search term" filename
- Print line number
grep -n "search term" filename
- More than One word
grep "word1\|word2" filename
- Print name of file
grep -l "word" *
- Specific word
grep -w "word" filename
- Display matched word only
grep -o 'word' filename
- Start with specific word
grep ^word filename
- End with specific word
grep word$ filename
- Print n lines before results( where n = Natural Numbers )
grep -B n "word" filename
- Print n lines after results
grep -A n "word" filename
-Print n line both before and after results
grep -C n "word" filename
- Lines starting with alphanumeric characters
grep ^[[:alnum:]] filename
Similarly for Alphabets: alpha
For digits: digit
For HexaDecimal: xdigit
For Tabs and Spaces: space
For punctuation: punct
Reference Links;
My Socials;
INSTAGRAM: @z1l_0x
DISCORD: @z1l0x
Tags;
#grep #linux #commands #tools
Комментарии