68.1k views
1 vote
In Linux: What command would you give to list all English-language words that are exactly 5 characters long and that have a lower-case vowel (‘a’, ‘e’, ‘i’, ‘o’, ‘u’, or ‘y’) in the second position, and end with ‘t’?

User Goodwine
by
5.8k points

1 Answer

3 votes

Answer:

grep '^.[aeiouy]..[t]$' /usr/share/dict/words

Step-by-step explanation:

The grep command is usually used in this situation.

^. The first dot in the command represents the first character of the word.

[aeiouy] represents lower-case vowel in the second position of any 5 character word the second charactere must be a lower case vowel.

.. The next two dots represents the next two characters of any 5 character word.

[t] represents the last character of any 5 character word because the last letter ends with t.

User Bart De Ruijter
by
6.2k points