linux command line print the occurrences of "'suasua'" 1

linux command line print the occurrences of “‘suasua'”

grep -o -i mauris example.txt | wc -l

Here is what the above code is Doing:
1. The first grep command is searching for the word “mauris” in the file example.txt.
2. The -o option tells grep to only print the matching part of the line.
3. The -i option tells grep to ignore case.
4. The second grep command is searching for the word “mauris” in the output of the first grep command.
5. The -o option tells grep to only print the matching part of the line.
6. The -i option tells grep to ignore case.
7. The wc command is counting the number of lines in the output of the second grep command.
8. The -l option tells wc to count the number of lines.

Similar Posts