- This topic has 0 replies, 1 voice, and was last updated 2 years, 4 months ago by .
Viewing 1 post (of 1 total)
Viewing 1 post (of 1 total)
- You must be logged in to reply to this topic.
Easy to Learn
Home › Forums › Grep Unix Command. › Here is few grep command which is frequently used to do many operation in unix.
Tagged: grep, grep -i, grep case sensitive., grep command, how to use grep command, unix
grep stands for global search for regular expression and print out.
Syntax:
grep [options] pattern [files]
1. Case in sensitive search in grep.
command : grep -i “appLE” fruitname.txt
explanation: option -i is enable the case sensitive search, above is the “appLE” will search on apple,Apple, APPLE, appLE and APPle.
2. Count of number of match.
command: grep -c “appLE” fruitname.txt
result :2
3. validate whole word.
command: grep -w “apple” fruitname.txt
4. display the line number
command: grep -n “apple” fruitname.txt