- "Do I Know This Already?" Quiz
- Foundation Topics
- Exam Preparation Tasks
Exam Preparation Tasks
As mentioned in the section “How to Use This Book” in the Introduction, you have a couple of choices for exam preparation: the exercises here, Chapter 21, “Final Preparation,” and the practice exams on the DVD.
Review All Key Topics
Review the most important topics in this chapter, noted with the Key Topics icon in the outer margin of the page. Table 5-3 lists a reference of these key topics and the page numbers on which each is found.
表5 - 3第5章的关键主题
关键话题Element |
Description |
Page Number |
Paragraph |
FHS documentation about what goes on the root volume |
113 |
Paragraph |
的use of the /usr and /usr/local/ directories |
114 |
Paragraph |
Relative pathnames and . (period character) |
116 |
Paragraph |
Long listing format (-l) to see permissions |
117 |
Paragraph |
Using thetouchcommand |
120 |
Paragraph |
Using a glob to avoid copying into a directory incorrectly |
122 |
Paragraph |
Locateneeds the database refreshed periodically |
129 |
Paragraph |
Locatesearches whole names |
130 |
Paragraph |
Examples offindusage |
131 |
Paragraph |
When to usewhereisversuslocate |
133 |
Paragraph |
的filename is not stored in the inode |
136 |
Note |
Symlinks consume inodes |
136 |
Paragraph |
的order and function oftar’s options |
138 |
Paragraph |
Creating atararchive |
138 |
Paragraph |
bzip2has the highest compression rate |
138 |
Paragraph |
的-voption to tar |
141 |
Paragraph |
cpioaccepts its files from the standard input |
142 |
Define Key Terms
Define the following key terms from this chapter and check your answers in the glossary:
- File System Hierarchy Standard
- relative path
- absolute path
- hard link
Review Questions
的answers to these review questions are in Appendix A.
You are installing a customized server and need to strip the root filesystem down to the essentials only. According to the FHS 2.3, which of the following are considered optional on the root (/) filesystem? (Choose two.)
- /root
- /usr
- /tmp
- /home
One of your programmers has produced an order entry system that will be shared among your users from a central file server. What is the appropriate directory to place this program and its associated files in?
- /usr/local/bin
- /usr/local
- /usr/share
- /opt
Which of the following is a true statement about files on a default Linux system? (Choose all that apply.)
- Filenames can start with a number.
- Filenames can contain multiple periods.
- Filenames can contain spaces.
- Filenames can contain ampersands.
- Filenames can contain backslashes.
You find a string in a shell script that contains the following command:
cp /data/*.doc ~tarfoo
What is the meaning of the characters ~tarfoo?
- A special function named tarfoo
- A directory named tarfoo in your home directory
- 的tarfoo user’s home directory
- 的/data/tarfoo directory
You are currently in the directory /home1/user1/subdir1 and need to navigate to the directory /home12/user3. Which of the following commands will accomplish this?
- cd home12/user3
- cd ~/user3
- cd ../../home12/user3
- cd ../../../home12/user3
You have a directory named /dir1 that contains subdirectories and regular files. You want to replicate this directory structure exactly into an existing directory named /dir2. Which of the following commands accomplish this? (Choose all that apply.)
- cp –-contents dir1/ /dir2
- cp –r /dir1/* /dir2
- xcopy /dir1 /dir2
- cp –r /dir1 /dir2
You are currently in the /bbb directory and want to move the contents from the /ccc directory to this one. What is the shortest command that will accomplish this?
- mv /ccc/*.* .
- mv ../ccc/*.* .
- mv /ccc/* .
- mv /ccc/ /bbb
Which option to themkdirandrmdircommands allows you to create a nested subdirectory tree?
Example:
/dir1/dir2/dir3/dir4
- -c
- -n
- -d
- -p
You are the sysadmin of a busy server and need to save space on your /home partition. You need to remove all files namedcorethat are older than seven days in the users’ home directories, without receiving any prompts.
- find /home –mtime +7 –name core –exec rm –f {} \;
- find ~ -mtime +7 -name core -exec rm -f {} \;
- find /home -mtime -7 -name core -exec rm -f {} \;
- find /home -older 7d -name core -exec rm -f {} \;
Which of the following situations would prevent you from creating a hard link?
- 的link spans filesystems.
- 的source of the link is a hidden file.
- 的source of the link is a device file.
- 的source of the link is a directory.
- 的destination contains special characters.
How would you back up Rebecca’s home directory using the best compression available?
- cd /home; tar -czf rebecca.tgz rebecca
- find ~rebecca | tar -cjf - > rebecca.tar.bz2
- tar -cjf rebecca.tar.bz2 ~rebecca
- tar -xjf rebecca.tar.bz2 ~rebecca