I am looking for a way to search a file for a specific pattern '.00' and want to calculate how often it appears. grep -o '.00' file does this quite well. Unfortunately I do not know how to exclude any pattern which contains the pattern I want to have but is a longer string.
What I want to have :
number of times, '.00' appears in the file
What I want to exclude :
longer patterns like '0.000001' so everything '*.00*'
Does anybody have an idea? Could I do something like "grep -o ('.00' and not '*.00*') ?
Thanks in advance, advice and boosting appreciated.
@IntegralDuChemin the -v will inverse grep (apply NOT)
@freemo Ah I see. Just a stupid question - what means "something" in that case? Another command for displaying my file like "less file"? Thanks in any case
@IntegralDuChemin yea another command, find makes the most sense if you wanna go recursive
@freemo Great thanks. In my case less should do as well 🙂
@IntegralDuChemin do it like this
something | grep ".00" | grep -v ".00*"