Guide to UNIX Using Linux
A limited time offer! Get a custom sample essay written according to your requirements urgent 3h delivery guaranteedOrder Now
1.You are starting a new year and need to create ten empty files for your accounting system. Which of the following commands or operators enable you to quickly create these files? (Choose all that apply.)Answer: b. >
2.Your project team uses a group of the same files and tracks whether they are still in use by looking at the last modified date. You need to show that a series of files are still in use by changing the last modified date to today. What command do you use?Answer: c. touch
3.Which of the following are ways in which you can structure a record containing data? (Choose all that apply.)Answer: c. fixed-length and d. variable-length
4.You need to delete 30 files that all start with the letters “customer,” such as customer_accounts, customer_number, and so on. Which of the following commands enables you to quickly delete these files? Answer: d. rm customer*
5.You are in your home directory and need to copy the file MemoRequest to a folder under your home directory called Memos. Which of the following commands do you use?Answer: a. cp MemoRequest Memos
6.You have a personnel file that contains the names, addresses, and telephone numbers of all employees. The first field in the personnel file is the employee number and the second field is the employee last name. The third field is the first name and middle initial. Because there are no employees with the same last name, you want to check the file by last name to make certain all employees are included. Which of the following commands should you use?Answer: b. cut -f2 personnel
7.You are doing some “house cleaning” and want to delete several empty directories. Which of the following commands can you use? (Choose all that
apply.)Answer: a. rmdir
8.You are trying to use the command sort –t: +5 datastore, but you get an error message each time you try it. How can you save the error message in a file called error, so you can e-mail the file to your computer support person?Answer: d. Enter sort -t: +5 datastore 2> error.
9.Which of the following commands would you use to make a backup copy of the file AR2008?Answer: c. cp AR2008 AR2008.bak
10.You have a lot of subdirectories under your home directory and know that you saved the file supplemental in one of them, but you are not sure which one. After you use cd to change to your home directory, which of the following commands enables you to search all of your subdirectories for the file?)Answer: d. find -name supplemental
11.You have created a script file called sum_report in your home directory and have made it executable. What command do you use to run the script?Answer: a. ./sum_report
12.Standard output is referred to as which of the following?Answer: b. stdout
13.Which of the following conditions must be met for you to combine two files using the join command? (Choose all that apply.)Answer: c. The two files must have a common field, such as last name.
14.Which of the following commands can you use to sort the file vendor_name and display the results on the screen?Answer: d. sort vendor_name15.When you use the paste command, columns of information are separated by a tab. However, your boss wants the columns separated by a colon. What option enables you to specify the colon as the separator?Answer: b. -d:
16.You are examining your addresses file, which contains the first and last names of people you know as well as their street address, city, state, zip code, and telephone number. You want to print a list of last names, which is field 1, and telephone numbers, which is field 7. Which of the following commands enables you to print this list?Answer: c. cut -f1,7 addresses
17.You keep a yearly record of the birds you’ve seen in your town. The name of the file is birds. The file contains the following fields name (field 1), markings (field 2), year(s) viewed (field 3), and location (field 4). You want to review the contents of the file, sorted by location. Which of the following commands do you use?Answer: a. sort -k 4 birds
18.Which of the following can be accomplished with the mv command? (Choose all that apply.)Answer: a. move a file and c. rename a file
19.Your boss asks you to create a professional-looking report from the contents of two files. Which of the following tools enables you to produce a polished report?Answer: b. awk
20.What command enables you to sort the contents of a file in reverse order?Answer: d.sort -r
21.You want to combine two files, data07 and data08, into a file called data_all. Which of the following commands do you use?Answer: d. cat data07 data08 > data_all
22.How can you use the touch command to create four new files called sum, datanew, results, and calcs (using one command line)?Answer: At the command line type touch sum, datanew, results, and calcs and press Enter. Alternatively you could also enter touch sum ; touch datanew ; touch results ; touch calcs. (Consider giving extra credit to students who provide both as answers.)
23.Create a command that sorts on the second field in the file addresses, and then writes the sorted results to the new file sorted_addresses.Answer: The command that can accomplish this is sort -k 2 addresses > sorted_addresses.
24.Create a command that enables you to copy all of the files in the spreadsheets directory to the accounts directory (when both directories are first-level directories under your home directory and you are currently in your home directory).Answer: The command to use is cp spreadsheets/* accounts.
25.You play guitar and keep two files on your computer. One file, called strings, lists the different brands of strings you keep on hand. Another file, called music, lists the music books and scores you own. When you enter the command paste strings music, what happens?Answer: You see two columns side-by-side on the screen. The left column lists the stings and the right column lists the music books.