1

This question already has an answer here:

I'm trying to find out on how to use grep command to find the number of vowels in each word in the correct order in the word file on the root user. I've tried grep -Ew "*[aeiou]*" words But, it never gave me the number of how many such words are there.

marked as duplicate by user88036, Jeff Schaller, Community Oct 9 '18 at 18:37

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • @msp9011 sure, you want the file? The file is 'words' it's located in the root directory, and I'm trying to find the number of vowels in each word in the correct order in that file. – Anonymous Oct 9 '18 at 18:06
  • It's not clear what you want; is it something like perl -nle 'my %k; $k{$_}++ for m/[aeiou]/g; print $_, map " $_:".($k{$_}+0), qw(a e i o u)' /usr/share/dict/words ? – mosvy Oct 9 '18 at 18:12
  • .. or grep '.*a.*e.*i.*o.*u' /usr/share/dict/words=> abstemious, adventitious, facetious, ..., sacrilegious? – mosvy Oct 9 '18 at 18:14
  • @msp9011 Okay here it is but, couldn't ctrl c very quickly to stop it. berserker berserks Bersiamite Bersil bersim berskin berstel Berstine BERT Bert Berta Bertasi Bertat – Anonymous Oct 9 '18 at 18:16
  • @mosvy 2nd one yes, but, I'm trying to use grep on words to find a word that contains each of the vowels in the correct order. To find how many such words are there. It's in /root/words I'll try that grep '.*a.*e.*i.*o.*u' /usr/share/dict/words – Anonymous Oct 9 '18 at 18:19
0

From man:

-c, --count

Suppress normal output; instead, print a count of matching lines for each input file.

Not the answer you're looking for? Browse other questions tagged or ask your own question.