- "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.
Table 5-3 Key Topics for Chapter 5
Key Topic Element |
Description |
Page Number |
Paragraph |
FHS documentation about what goes on the root volume |
113 |
Paragraph |
The 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 the touch command |
120 |
Paragraph |
Using a glob to avoid copying into a directory incorrectly |
122 |
Paragraph |
Locate needs the database refreshed periodically |
129 |
Paragraph |
Locate searches whole names |
130 |
Paragraph |
Examples of find usage |
131 |
Paragraph |
When to use whereis versus locate |
133 |
Paragraph |
The filename is not stored in the inode |
136 |
Note |
Symlinks consume inodes |
136 |
Paragraph |
The order and function of tar’s options |
138 |
Paragraph |
Creating a tar archive |
138 |
Paragraph |
bzip2 has the highest compression rate |
138 |
Paragraph |
The -v option to tar |
141 |
Paragraph |
cpio accepts 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
The 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
- The tarfoo user’s home directory
- The /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 the mkdir and rmdir commands 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 named core that 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?
- The link spans filesystems.
- The source of the link is a hidden file.
- The source of the link is a device file.
- The source of the link is a directory.
- The 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