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.

@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

Follow

@IntegralDuChemin yea another command, find makes the most sense if you wanna go recursive

Β· Β· 0 Β· 0 Β· 1

@freemo Great thanks. In my case less should do as well πŸ™‚

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.