Question

These are linux commands. Type cd /usr/share/dict. The file words is the Linux English dictionary. You...

These are linux commands. Type cd /usr/share/dict. The file words is the Linux English dictionary. You will use egrep to explore this file. Your answers below will be the egrep command that solves the problem.

a.List all words that have the letter a followed immediately by the letter z.

b.List all words that have the letter a followed sometime later by the letter z (there must be at least one letter in between).

c.List all words that start with the letter a and end with the letter z.

d.List all five letter words that start with the letter a and end with the letter z.

e.List all words that start with two capital letters followed immediately by at least one lower case letter.

f.List all words with two consecutive a’s, i’s or u’s. Recall that | means “or”.

g.List all words that contain a q followed by a non-u (Iraqi should be listed, but queen should not).

h.List all entries in the file that contain at least one non-letter.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Let me know if you have any doubts.

cd /usr/share/dict
a:
egrep \s*az*\s words

b:
egrep \s*a+z*\s words

c:
egrep ^a*z$ words

d:
egrep ^a...z$ words

e:
egrep ^[A-z][A-Z][a-z].*\s words

f:
egrep \s*(aa | ii | uu)*\s words

g:

egrep \s*q[^u]*\s words

Add a comment
Know the answer?
Add Answer to:
These are linux commands. Type cd /usr/share/dict. The file words is the Linux English dictionary. You...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write a Python equivalent program for the Unix spell utility. You can use the dictionary at /usr/...

    Write a Python equivalent program for the Unix spell utility. You can use the dictionary at /usr/share/dict/words (if you machine does not have it, you can copy it from a Linux machine such as npu29). The minimum requirement is to check if each word in the file exists in the dictionary as is (case insensitive). Your spell checker should inlcude at least two features: 1. Check the simple plural forms (add s or es). 2. Check the simple verb past...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT