Vous êtes sur la page 1sur 8

Exam 101 Practice Test

1. How would you direct the output of the uptime command to a file called uptime-stats.txt?
A. echo uptime uptime-stats.txt
B. uptime > uptime-stats.txt
C. uptime | uptime-stats.txt
D. uptime < uptime-stats.txt

2. A program’s instructions say that the $FIRMWARE environment variable must be set to
/lib/firmware/tp9173.fw. How can you verify that this is so?
A. Type echo $FIRMWARE and verify that the command returns /lib/firmware/tp9173.fw.
B. Type fw-verify and look for FIRMWARE=/lib/firmware/tp9173.fw in the output.
C. Type echo FIRMWARE and verify that the command returns /lib/firmware/tp9173.fw.
D. Type export FIRMWARE=auto to automatically set the $FIRMWARE environment variable.

3. What is the purpose of the cut command?


A. It copies the contents of a file to the screen.
B. It extracts information from within lines of a file.
C. It divides a file into as many parts as you specify with the -p parameter.
D. It deletes a file and overwrites its former contents for security.

4.What is the function of the following command


$ export THEFILE=/usr/local/bin/theprogram
A. It causes /usr/local/bin/theprogram to be run whenever a file called THEFILE is accessed in bash.
B. It causes /usr/local/bin/theprogram to be run whenever the user types THEFILE.
C. It sets the value of the environment variable $THEFILE to /usr/local/bin/theprogram.
D. None of the above; the command is malformed.

5. You want to load all the files with filenames that end in .txt within the current directory tree (not
just the current directory) into the emacs file editor. What might you type to do this?
A. emacs *.txt
B. grep *.txt | emacs
C. emacs | find ./ -name "*.txt"
D. emacs `find ./ -name "*.txt" `

1
6.You want to quickly examine the last few entries in /var/log/messages. Which of the following
commands will do this?
A. lastlines /var/log/messages
B. tail /var/log/messages
C. bash /var/log/messages
D. cp /var/log/messages

7.Which of the following tools is designed to help keep your system’s software packages up to date?
(Select all that apply.)
A. System Commander
B. bash
C. APT
D.YUM

8. What function does the apt-cache program play on Debian-based systems?


A. It caches Debian packages as they’re being downloaded from the Internet, permitting faster
installation.
B. It displays various types of information about installed packages, such as package names and
number of installed packages.
C. It temporarily disables disk caching, ensuring that sensitive package management operations are
not corrupted in case of a power failure.
D. It changes the style of widgets used by the Synaptic package manager to fit in better with
whatever window manager you’re using.

9. Which of the following are arguments you can pass to the kernel at boot time to tell it to start in
runlevel 1 (single-user mode)?
a. one
b. 1
c. safe
d. single
e. user

10.if you want to change your system’s default boot device from the hard drive to the CD-ROM drive,
where would you make that configuration change?
a. The file /boot/grub/grub.conf
b. The file /etc/lilo.conf
c. An argument passed to the kernel at boot time
d. The BIOS
e. The file /etc/initial

2
11. What command line would reboot a running Linux system immediately, forcing an fsck of every
drive on reboot?
a. /sbin/shutdown –r –F now
b. /sbin/shutdown –h –F now
c. /sbin/shutdown
d. /sbin/shutdown –r –f now
e. /sbin/shutdown –t –f

12. Which command is used to display the current mounted partitions, their mount points, and the
available free space on each?
a. du
b. df
c. fdisk
d. fsck
e. mount

13. Which partition is designed to hold data that changes often and is writable by all users?
a. /var
b. /home
c. /tmp
d. /opt
e. /sys

14.Which of the following lines in /boot/grub/grub.conf would tell GRUB to use the first partition of
the first hard drive as the root partition?
a. root (hd0,0)
b. boot (hd0,0)
c. root (hd1,1)
d. boot (hd1,1)
e. root (hd1,0)

15.What file contains a list of directories that are searched to find shared libraries
when a binary program is executed?
a. /etc/loader.conf
b. /etc/library/conf
c. /etc/ld.so.cache
d. /etc/ld.so.conf
e. /etc/ld.conf

3
16.For distributions that use the Red Hat package management system, what command will
download and update all installed packages to the latest available version?
a. yum update
b. yum install
c. yum config
d. yum list available
e. yum download

17. What option(s) to rpm will instruct rpm to run a verification check on all packages installed on the
system?
a. rpm –verify –all
b. rpm –Va
c. rpm –qa
d. rpm –check
e. rpm –c

18. What commands can be used to view a list of the last commands typed into the shell?
a. history
b. <Ctrl-R>
c. <up arrow>
d. All of the above
e. None of the above

19.Which of the following commands will redirect the standard output of /bin/ls to /dev/null, while
allowing standard error to display on the screen?
a. /bin/ls > /dev/null 2> /dev/screen
b. /bin/ls 1> /dev/null
c. /bin/ls > /dev/null
d. /bin/ls > /dev/null 2>&1
e. /bin/ls 2> /dev/null 1>&2

20.Which commands can be used to perform a search and replace on a file or a text stream?
a. sed
b. tr
c. search
d. cat
e. more

4
21.What command(s ) can be used to copy data to and from raw devices, bypassing the filesystem?
a. cp
b. tar
c. dd
d. mv
e. sed

22.What option can be passed to /bin/ls to display every file that starts with the letters a, b, or c?
a. ls abc*
b. ls a*b*c*
c. ls ^abc
d. ls [abc]+
e. ls [abc]*

23. Which of the following commands would list the contents of the directory /tmp, store that list in
the file /root/tmp.txt, and display the list a screen at a time?
a. ls –l /tmp | tee /root/tmp.txt | more
b. ls –l /tmp | xargs /root/tmp.txt | more
c. ls –l /tmp | more | tee /root/tmp.txt
d. tee /root/tmp.txt | ls –l /tmp | more
e. more /tmp | tee /root/tmp.txt

24.What command is used at the beginning of a command line to detach the process from a terminal,
allowing it to continue running after the user has logged out?
a. hangup
b. detach
c. nohup
d. background
e. bg

25.Which command(s) would display every line in /tmp/file.txt that begins with the letter h and ends
with the letter t?
a. grep "^h.+t$" /tmp/file.txt
b. grep –E "^h.+t$" /tmp/file.txt
c. grep –E "$h.+t^" /tmp/file.txt
d. grep –E "$ht^" /tmp/file.txt
e. grep –E "^h.*t$" /tmp/file.txt

5
26.Which of the following are examples of journaling filesystems?

a. ext2

b. ext3

c. xfs

d. reiserfs

e. ext4

27. A system administrator installs a package by typing rpm -U bigprog-1.2.3-4.i386.rpm --nodeps.


What is one possible consequence of this installation command?

A. Subsequent attempts to install more recent versions of bigprog are likely to fail because of the
lack of dependency information.

B. The program may not work correctly if any unmet dependencies were ignored because of the
--nodeps option.

C. If an earlier version of a package called bigprog is already installed, this installation command will
fail.

D. The --nodeps option forces installation even if another bigprog package is installed, which may
cause strange problems because of file version mismatches.

28. In auditing program files, you notice that the set user ID (SUID) bit is set on several program files.
Which of the following files should almost certainly not have this bit set? (Select all that apply.)

A. /usr/bin/passwd

B. /bin/vim

C. /sbin/fdisk

D. /usr/X11R6/bin/xterm

29. What does the edquota utility do?

A. It enables the disk quotas on the disk device that you specify with the command.

B. It launches a text editor on a temporary file that enables you to edit a user’s disk quotas.

C. It eliminates all disk quota records for the disk device that you specify with the command.

D. It checks for errors in the disk quota system—whether any user’s quotas are over their limits.

6
30. Which of the following commands displays the contents of a tarball, including file sizes and time
stamps?
A. tar xzf theprogram-1.2.3.tgz
B. tar tzf theprogram-1.2.3.tgz
C. tar tvzf theprogram-1.2.3.tgz
D. tar x theprogram-1.2.3.tgz

31.Which of the following programs returns filenames that begin with whatever you type as a search
criterion in a restricted set of locations, such as standard binary file directories, library directories,
and man page directories, even if those files contain extensions?

A.whereis
B.locate
C.slocate
D.map

32. You begin editing an existing configuration file in Vi and make several changes; but you realize
you’re editing the wrong file, and you wish to abandon all your changes. How may you do so, leaving
the original file untouched?
A. You can’t; Vi writes changes to the file as you make them, so the original file is already changed.
B. Select File ( Abandon from the Vi menu, and then click Yes in the confirmation dialog box.
C.Enter edit mode by typing i, if necessary, and then press Ctrl+X followed by Ctrl+Q.
D.Enter command mode by pressing Esc, if necessary, and then type :q!.

33. What type of troubleshooting information can typing dmesg soon after booting a computer
reveal?
A. Incorrect X resolution settings that could damage the monitor
B. Inconsistencies in user account configurations
C. The inability of the computer to obtain an IP address from a DHCP server
D. The failure to detect certain hardware devices, such as CD-ROM drives

34. While editing a file in Vi at a text-mode login, you want to view another file, files.txt, without
exiting Vi. How might you do this?
A. In Vi’s command mode, type :!less files.txt.
B. In Vi’s command mode, type i and then type cat files.txt.
C. In Vi’s command mode, type :q! and then type less files.txt.
D. In Vi’s command mode, type o and then type cat files.txt.

7
35. Which commands is used to modify the priority of a process already running?
a. nice
b. renice
c. priority
d. top
e. ps

Vous aimerez peut-être aussi