Find the answer to your Linux question:
Results 1 to 5 of 5
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    vowels - grep command

    i want to write a command using grep ..
    so that i can find all the words in my file having exactly 1 vowel.
    i tried using grep -iw ".\?[aeiou]\?" k.txt
    but it dosnt' seem to work.
    any suggestions on how to get this done ?

  2. #2
    Super Moderator Roxoff's Avatar
    Join Date
    Aug 2005
    Nottingham, England
    Homework questions are not allowed here. You should talk to your teacher or tutor if you're having difficulty with your coursework.

    You definitely shouldn't use Google to search for examples of regular expression use, or consult the man page for grep, which has an extensive section on this
    Linux user #126863 - see

  3. #3
    i knw..
    i just want some hint or suggestion on how to approach the question.

  4. $spacer_open
  5. #4
    A hint? RTFM.

    I know that's rude and crude, but that's how the rest of us learned.

  6. #5
    Just Joined!
    Join Date
    Dec 2009
    So, you've got a bunch of words in a file. Are they one per line? or is it like a normal text file with a bunch of sentences?

    Assuming it's a bunch of sentences, you'll need to use a command to put each word on it's own line. Have a look at at "tr" for that.

    Your grep command is too complicated. remove the "w". You do need the "i". In the grep man page, look for "class" of characters. You are on the right track with what you have, but the answer is less complex....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts