15 lines
431 B

5 years ago
echo "Inverting the pattern match"
5 years ago
grep -v "Jordan" $LLO_DATAFILE | head -5
5 years ago
5 years ago
echo "Matching the lines that start with a string"
grep -n "^Mi" $LLO_DATAFILE | tail -5
5 years ago
echo "Matching the lines that end with a string"
grep -n "15$" $LLO_DATAFILE | tail -5
5 years ago
echo "Checking for the whole words in a file"
grep -w "Jordan" $LLO_DATAFILE | tail -5
5 years ago
5 years ago
echo "Displaying only the matched pattern"
grep -o "Jordan" $LLO_DATAFILE | tail -5