Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

By using Unix and Regex: Now let’s get to it: To start, here is a simple puzzle.

ID: 3700533 • Letter: B

Question

By using Unix and Regex:

Now let’s get to it:

To start, here is a simple puzzle. What are all the English words that begin with “qu” and ending with “y”. [Hint: Remember that each line of the dictionary file contains only a single word.]

Our last puzzle involves a search of the Unix file system for historical artifacts. Many of the original Unix commands were two letters long; the text editor was ed, the copy program was cp, and so on. Let us find all such commands. To solve the puzzle, you need to know that the very oldest Unix programs reside in the /bin directory. There are other old Unix command in /usr/bin. Be sure to also provide a count of how many such commands there are.

Explanation / Answer

Solution:

grep '^qu.*y$' words

//^ is used for giving the words which starts with the letter with which it is used, and $ is to match at the end.

and * means 0 or multiple occurences of any letters in between.

I hope this helps if you find any problem. Please comment below. Don't forget to give a thumbs up if you liked it. :)