Guide to UNIX Using Linux Fourth Edition
Chapter 5 Solutions
Answers to the Chapter 5 Review Questions
1. You have just finished a 25-page paper that you have written using Emacs. The file containing the
paper is called /assignments/data_sources. After your instructor has briefly looked at the paper,
she recommends that you change all instances of the reference “data is” to “data are” before you
submit it. Which of the following commands can you use to locate these references in the file for a
quick assessment of how much you have to change?
2. You are interested in determining the number of words in your /assignments/data_sources file
mentioned in Question 1. Which of the following commands should you use?
3. Which of the following are examples of manipulation and transformation commands? (Choose all
that apply.)
4. Which of the following is true of the pipe operator? (Choose all that apply.)
5. Because the data was formatted the same in two inventory files, you decided to combine their
contents into one file. Now you want to determine if there are duplicate entries on consecutive
lines in the new file. Which of the following commands enables you to find the duplicate entries?
6. Your friend is using the command comm entryfile, but is getting an error message. What is the
problem? (Choose all that apply.)
7. Your boss is trying to import the customers file into her spreadsheet program, but the data goes
into the spreadsheet incorrectly. This is because the fields are separated by dashes (-) and the
spreadsheet program requires the fields to be separated by colons (:). Which of the following
commands can you use to convert the customers file?
8. How can you link multiple files to manipulate the data in those files?
9. While in the Bash shell, you have written a simple script file and now want to execute the script.
Which of the following commands enables you to run the script?
10. You are using the grep command, but it is only searching through files in your immediate home
directory. What option enables you to search through subdirectories below your home directory?
11. Your software has a bug in that it enables you to create a vendors file in which there are duplicate
entries of vendors. Which of the following methods enables you to remove the duplicate vendors
in this text file?