linux get count linus using grep code example
Example 1: count occurrences of word in file linux
grep -wc "your_text" FileName
Example 2: grep ocurrences
Just use flag -m to define number of occurrences to match:
grep -m1 pattern file
grep -wc "your_text" FileName
Just use flag -m to define number of occurrences to match:
grep -m1 pattern file