Question
The dictionary file, which has been included with Unix from the very beginning, contains a very long list of English words, including, most of the
The dictionary file, which has been included with Unix from the very beginning, contains a very long list of English words, including, most of the words commonly found in a concise dictionary. Each word is on a line by itself and the lines are in alphabetical order, which makes the file easy to search. Once you get used to using the dictionary file imaginatively, you will be able to do all kinds of amazing things. Some Unix commands such as look use the dictionary file to do their work.
The name of the dictionary file is words. In the early versions of Unix, the words file was stored in a directory names /usr/dict. In recent years, however, the Unix file structure has been reorganized and, on most modern systems – including Linux and FreeBSD – the words file is stored in a dictionary named /usr/share/dict. On a few systems, such as Solaris, the file is stored in /usr/share/lib/dict. Thus, the pathname of the dictionary file may vary from one system to another. Be sure to locate this file on your system and use it to solve the puzzles.
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.]
The next puzzle is an old one. Find a common English word that contains all five vowels – a, e, i, o, u – in that order. The letters do not have to be adjacent, but they must be in alphabetical order. That is, “a” must come before “e”, which must come before “i”, and so on.
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.
Step by Step Solution
3.45 Rating (152 Votes )
There are 3 Steps involved in it
Step: 1
To solve the first puzzle we can use the following Unix command grep E quy usrsharedictwords This command will print all lines in the dictionary file ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started