A maior rede de estudos do Brasil

Grátis
86 pág.
1   CompTIA Linux+ Complete Study Guide Questions

Pré-visualização | Página 13 de 25

Chapter 4 N Managing Files
15. B. The repquota utility is used to summarize the quota information about the filesystem.
When used with the –a option, it shows this information for all filesystems. The quotacheck
utility checks quota information about a disk and writes corrections.
16. D. The /opt directory tree exists to hold programs that aren’t a standard part of a Linux dis-
tribution, such as commercial programs. These programs should install in their own directo-
ries under /opt; these directories usually have bin subdirectories of their own, although this
isn’t required. The /usr/sbin directory holds programs that are normally run only by the
system administrator, and /bin holds critical basic binary files. The /etc/X11 directory holds
X-related configuration files. None of these directories is an appropriate place for a spread-
sheet program.
17. A. The find utility operates by searching all files in a directory tree, and so it’s likely to
take a long time to search all of a computer’s directories. The locate program uses a pre-
compiled database, and whereis searches a limited set of directories, so these commands
will take less time.
18. C. The type command identifies a command, as executed by the shell, as being a built-in
shell command, a shell alias, or an external command, whereas the whereis command
helps find the location of external command files. Neither type nor whereis identifies the
CPU architecture of a program file, can locate commands based on intended purpose, or
complete an incompletely typed command.
19. B. The find command includes the ability to search by username using the -user name
option, where name is the username; thus, option B is correct. The -uid option to find can
also locate files owned by a user; but it takes a numeric user ID (UID) number as an argu-
ment, so option A isn’t quite correct. The locate command provides no ability to search by
user, so options C and D are incorrect.
20. D. The which program searches the path just as bash does, but it prints the path to the first
executable program it finds on the path. Thus, option D is correct. The which program
doesn’t conduct an exhaustive search of the system, so there could be many more files called
man on the system, contrary to option A. System package tools and which aren’t closely
related; option B is incorrect. Although /usr/bin/man would be run when the user whose
which output matches that in the question types man, this may not be true of others because
the path can vary from one user to another. Thus, option C is incorrect.
Review Questions 257
Review Questions
1. Where might the BIOS find a boot loader?
A. RAM
B. /dev/boot
C. MBR
D. /dev/kmem
2. You want to boot a Linux system into single-user mode. What might you type at a LILO
boot: prompt to accomplish this task?
A. s
B. single-user
C. linux 1
D. telinit 6
3. After booting, one of your hard disks doesn’t respond. What might you do to find out
what’s gone wrong?
A. Check the /var/log/diskerror log file to see what’s wrong.
B. Verify that the disk is listed in /mnt/disks.
C. Check the contents of /etc/inittab to be sure it’s mounting the disk.
D. Type dmesg | less, and peruse the output for disk-related messages.
4. What is the first program that the Linux kernel runs once it’s booted in a normal boot
process?
A. dmesg
B. init
C. startup
D. rc
5. Which of the following is the LILO boot loader configuration file?
A. /dev/lilo
B. The MBR
C. /boot/lilo/lilo.conf
D. /etc/lilo.conf
6. What should be the first line of a LILO configuration file stanza intended to boot a Linux
kernel stored as /boot/bzImage-2.6.26?
A. image=/boot/bzImage-2.6.26
B. image /boot/bzImage-2.6.26
C. kernel /boot/bzImage-2.6.26
D. kernel=/boot/bzImage-2.6.26
258 Chapter 5 N Booting Linux and Editing Files
7. Which command is used to install GRUB into the MBR of your first ATA hard drive?
A. grub (hd0,1)
B. grub-install /dev/hda1
C. lilo /dev/hda
D. grub-install /dev/hda
8. The string root (hd1,5) appears in your /boot/grub/menu.lst file. What does this mean?
A. GRUB tells the kernel that its root partition is the fifth partition of the first disk.
B. GRUB looks for files on the sixth partition of the second disk.
C. GRUB looks for files on the fifth partition of the first disk.
D. GRUB installs itself in /dev/hd1,5.
9. What line in /etc/inittab would indicate that your default runlevel is 5?
A. ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
B. id:5:initdefault:
C. si:5:sysinit:/etc/init.d/rcS
D. l5:5:wait:/etc/init.d/rc 5
10. Which runlevels are reserved by init for reboot, shutdown, and single-user mode pur-
poses? (Select all that apply.)
A. 0
B. 1
C. 5
D. 6
11. You type the following command:
$ runlevel
5 3
What can you tell about your runlevel status? (Select all that apply.)
A. The current runlevel is 5.
B. The current runlevel is 3.
C. The previous runlevel is 5.
D. The previous runlevel is 3.
12. A system administrator types the following command:
# shutdown -c
What is the effect of this command?
A. A previously scheduled shutdown is cancelled.
B. The system shuts down and reboots immediately.
C. The system shuts down and halts immediately.
D. The system asks for confirmation and then shuts down.
Review Questions 259
13. Which of the following commands may not be used instead of shutdown in certain
circumstances?
A. reboot
B. halt
C. poweroff
D. takedown
14. You want to change to single-user mode on a running system. What command might you
use to do this?
A. runlevel 1
B. telinit 1
C. shutdown -1
D. single-user
15. What does runlevel 4 do?
A. It reboots the computer.
B. It starts a multi-user system without X running.
C. It starts a multi-user system with X and an X-based login running.
D. Its purpose isn’t standardized, so it can be used for anything you like.
16. How would you remove two lines of text from a file using Vi?
A. In command mode, position the cursor on the first line and type 2dd.
B. In command mode, position the cursor on the last line and type 2yy.
C. In insert mode, position the cursor at the start of the first line, hold down the Shift key
while pressing the Down arrow key twice, and press the Delete key on the keyboard.
D. In insert mode, position the cursor at the start of the first line and press Ctrl+K twice.
17. In Vi’s command mode, you type :q!. What is the effect?
A. Nothing; this isn’t a valid Vi command.
B. The text :q! is inserted into the file you’re editing.
C. The program terminates and saves any existing files that are in memory.
D. The program terminates without saving your work.
18. What is an advantage of Vi over Emacs?
A. Vi is X-based and so is easier to use than Emacs.
B. Vi is smaller and so can fit on compact emergency systems and embedded devices.
C. Vi’s mode-based operations permit it to handle non-English languages.
D. Vi includes a built-in Web browser and e-mail client; Emacs doesn’t.
260 Chapter 5 N Booting Linux and Editing Files
19. From Vi’s command mode, you want to enter insert mode. How might you do this? (Select
all that apply.)
A. Type R.
B. Type i.
C. Type a.
D. Type :.
20. How do you exit Vi’s insert mode in order to type command-mode commands?
A. Press the ~ key.
B. Press the Esc key.
C. Type Ctrl+X followed by Ctrl+C.
D. Press the F10 key.
Answers to Review Questions 261
Answers to Review Questions
1. C. The Master Boot Record (MBR) can contain a boot loader that is up to 446 bytes in
size. If more space is required, the boot loader must load a secondary boot loader. Although
the boot loader is loaded into RAM, it’s not stored there permanently because RAM is vol-
atile storage. Both /dev/boot and /dev/kmem