What two commands display the status of processes on a Linux system?
ls and df
ps and top
ps and df
df and top
du and df
What does the device file /dev/hdb6 represent?
An extended partition on a SCSI disk drive
A logical partition on a SCSI disk drive
An extended partition on an IDE disk drive
A primary partition on an IDE disk drive
A logical partition on an IDE disk drive
Which command will display the last lines of the text file file1?
head -b file1
head --bottom file1
head -v file1
tail file1
tail -n 1 file1
In the Bash shell, entering !!
has the same effect as which one of the following?
Ctrl-P and Enter
Ctrl-N and Enter
Ctrl-U and Enter
!-2
!2
Which of the following commands can be used to check an ext2 filesystem? Select three that apply.
fsck -ext2 /dev/hda5
fsck /dev/hda5
e2fsck /dev/hda5
fsck.ext2 /dev/hda5
fsck.linux /dev/hda5
In response to the df command, the system reports a Use%
of 98%
for the filesystem mounted on /home. Which one of the following best describes the significance of this information?
Files on /home are consuming 98% of the physical disk.
File read/write activity on /home is consuming 98% of system I/O capacity.
Files on /home are consuming 98% of the /home filesystem.
Inodes on /home are nearly exhausted.
Inodes on /home are 98% free.
Of the following directories, which one is the most important to back up on a routine basis?
/var
/tmp
/usr
/root
/etc
Carolyn has a text file named guest_list containing 12 lines. She executes the following command. What is the result?
# split -4 guest_list gl
The first four columns in the text are written to new files glaa, glab, glac, and glad.
The first four columns in the text are written to new files aagl, abgl, acgl, and adgl.
The lines of guest_list are evenly divided among new files glaa, glab, glac, and glad.
The lines of guest_list are evenly divided among new files glaa, glab, and glac.
The lines of guest_list are evenly divided among new files aagl, abgl, and acgl.
Which one of the following commands would be best suited to mount a CD-ROM containing a Linux distribution, without depending on any configuration files?
mount /dev/cdrom /dev/hdc
mount -f linux /dev/hdc /mnt/cdrom
mount -t iso9660 /dev/cdrom /mnt/cdrom
mount -t linux /dev/cdrom /mnt/cdrom
mount -t iso9660 /mnt/cdrom /dev/cdrom
An ext2 filesystem is configured with user quotas enabled. The soft limit is set at 100 MB per user, the hard limit is set at 110 MB per user, and the grace period is seven days. User bsmith
already owns 90 MB of the data stored on the filesystem. What happens when bsmith
writes a new file of size 30 MB? Select one.
The write will fail, but the superuser can recover the entire file within seven days.
The write will fail, and the file will be truncated permanently.
The write will succeed, but the file will be truncated permanently.
The write will succeed, but the file will be available for only seven days.
The write will succeed, but the file will be truncated in seven days.
Which of the following commands displays the comments from a bash script? Select all that apply.
find "^#" /etc/rc.d/rc.local
sed '/^#/ !d' /etc/rc.d/init.d/httpd
grep ^# /etc/rc.d/init.d/httpd
grep ^# /etc/passwd
locate "^#" /etc/skel/.bashrc
State the syntax to direct the standard output of cmd1 directly into the standard input of cmd2.
Which one of the following answers creates an environment variable VAR1
, present in the environment of a bash child process?
VAR1="fail" ; export VAR1
VAR1="fail" export VAR1
VAR1="fail"
set VAR1="fail" ; enable VAR1
export VAR1 VAR1="fail"
Which of the following directories must be part of the root filesystem? Select two of the following that apply.
/etc
/home
/lib
/usr
/root
Alex is currently working in a directory containing only one file, Afile1. What is displayed after the following commands are entered in bash?
#MYVAR=ls
#echo $MYVAR "$MYVAR" '$MYVAR' '$MYVAR'
Afile1 Afile1 Afile1 Afile1
ls Afile1 Afile1 Afile1
ls ls Afile1 Afile1
ls ls $MYVAR Afile1
ls ls ls $MYVAR
What does the &
character do when placed at the end of a command?
It allows another command to be entered on the same line.
It causes the process to be stopped.
It restarts a stopped process.
It causes the process to be placed into the foreground.
It causes the process to be placed into the background.
Which one of the following commands could be used to change all uppercase characters to lowercase in the middle of a pipe?
grep
egrep
wc
tr
pr
What is the PID of init? Select one.
0
1
2
undefined
unknown
Which one of the following outcomes results from the following command?
# chmod g+s /home/software
The SUID bit will be set for /home/software.
The SGID bit will be set for /home/software, preventing access by those not a member of the software
group.
The SGID bit will be set for /home/software, in order to keep group membership of the directory consistent for all files created.
The sticky bit will be set for /home/software.
The sticky bit will be applied to all files in /home/software.
Which one of the following commands is equivalent to the following command for user jdoe
whose home directory is /home/jdoe?
# chmod 754 ~/file1
chmod u=rwx,g=rx,o=r /home/jdoe/file1
chmod ugo=rwx ~/file1
chmod u=7,g=5,o=4 ~/file1
chmod 754 homejdoefile1
chmod 754 /usr/jdoe/file1
What command and single required option creates a symbolic link in a Linux filesystem?
What command can display the contents of a binary file in a readable hexadecimal form? Select one.
xd
hd
od
Xd
dump
Which one of the following commands copies files with the .txt extension from /dir1 into /dir2, while preserving file attributes such as dates?
mv --copy /dir1/*.txt /dir2
mv /dir1/*.txt /dir2
cp -k /dir1/*.txt /dir2
cp -p /dir1/*.txt /dir2
cp -p /dir2 < /dir1/*.txt
Which one of the following file globs matches "Linux" and "linux," but not "linux.com" and not "TurboLinux"?
[L/linux]
?inux
Llinux
[Ll]inux
[Ll]inux?
A process with PID 4077 is misbehaving on your system. As superuser, you enter the following command:
# kill 4077
However, nothing changes as a result. What can you do to terminate the process? Select one.
kill -9 4077
kill -1 4077
kill +9 4077
kill 4078
kill --die 4077
Which one of the following key sequences is used to put a noninteractive text-mode program that is attached to the terminal into the background to allow it to continue processing?
Ctrl-C
Ctrl-B
Ctrl-B and then enter the bg command
Ctrl-Z
Ctrl-Z and then enter the bg command
What basic command is used to create hard disk partitions?
With a umask of 027, how is the initial mode set for a newly created file?
0750
0640
0027
1027
1640
Which one of the following commands verbosely extracts files from a tar archive on a magnetic tape device?
tar cvf /dev/st0
tar cvf /dev/ttyS0
tar xvf /dev/st0
tar xvf /dev/ttyS0
tar rvf /dev/st0
Alex wants to protect himself from inadvertently overwriting files when copying them with cp. How should he go about this?
Put alias cp='cp -i'
in ~/.bashrc.
Put alias cp='cp -i'
in ~/.bash_profile.
Put alias cp='cp -p'
in ~/.bashrc.
Put alias cp='cp -p'
in ~/.bash_profile.
Put alias cp='cp -I'
in ~/.bashrc.
Which one of the following utilities outputs a text file with line numbers along the left margin?
tar
wc
tr
nl
ln
The following line comes from /etc/fstab Which of the statements is accurate given the contents of this line? Choose two that apply.
/dev/fd0 /mnt/fd0 vfat noauto,users 0 0
Users are prohibited from mounting and unmounting the filesystem.
Users are permitted to mount and unmount the filesystem.
The filesystem will be mounted on mount point /dev/fd0.
The filesystem is expected to be a Linux native filesystem.
The filesystem is on a floppy disk.
Which one of the following is an accurate statement regarding this regular expression?
[^1-8A-Za-z]
It matches all letters and numbers.
It matches all letters and numbers except 9.
It matches all letters and numbers except 9 and 0, but only at the beginning of a line.
It matches 9, 0, and other nonletter and nonnumber characters.
It matches characters other than letters or numbers.
Monica consults the /etc/passwd file expecting to find encrypted passwords for all of the users on her system. She sees the following:
jdoe:x:500:500::/home/jdoe:/bin/bash bsmith:x:501:501::/home/bsmith:/bin/tcsh
Which of the following is true? Select one.
Accounts jdoe
and bsmith
have no passwords.
Accounts jdoe
and bsmith
are disabled.
The passwords are in /etc/passwd-
The passwords are in /etc/shadow
The passwords are in /etc/shadow-
What command (include applicable options) is used to initiate a change to runlevel 5?
What does the "sticky bit" do? Select one.
It prevents files from being deleted by anyone.
It marks files for deletion.
It prevents files from being deleted by nonowners except root
.
It prevents files from being deleted by nonowners including root
.
It marks files for archive.
Dave has a Linux system with an interrupt conflict caused by his 3c509 network card. Dave's kernel is fully modular. How could Dave instruct the system to use IRQ 11 for his network adapter?
Enter linux eth0=irq11
at the LILO boot loader prompt.
Enter linux 3c509=irq11
at the LILO boot loader prompt.
Add options 3c509 irq=11
to /etc/conf.modules.
Add options irq=11 3c509
to /etc/conf.modules.
Add ifup -irq 11 eth0 to /etc/rc.d/rc.sysinit.
What is contained in directory /sbin? Select the single best answer.
Commands needed in the event of a system emergency of interest to all system users.
Commands of interest to all system users.
Commands needed in the event of a system emergency of interest mainly to the administrator.
Commands of interest mainly to the administrator.
Libraries needed in the event of an emergency.
What ext2 filesystem attribute allows a process to take on the ownership of the executable file's owner?
What is appended to the beginning of a command line in order to modify the execution priority of the resulting process?
How are the cat and tac commands related? Select one.
cat displays files and tac does the same but in reverse order.
cat concatenates files while tac splits a file into pieces.
cat creates file catalogs while tac displays the catalogs.
The two commands are links to the same executable.
There is no relation or similarity between cat and tac.
With regard to the use of regular expressions to match text in a file, describe a metacharacter. Select one.
They are standard text characters used in the regular expression.
They are special control characters used in the regular expression.
They are used to display results after using a regular expression.
They are used by the shell to display graphics.
Metacharacters aren't used in regular expressions.
How many IDE devices can be installed and simultaneously used in a typical Intel-based system? Select one.
1
2
3
4
5
Which one of the following would be a consequence of a filesystem running out of inodes?
More inodes would be automatically created in the filesystem.
Quotas would become disabled on the filesystem.
The filesystem would be corrupted.
The filesystem would be marked read-only.
No writes would be possible on the filesystem until existing files were deleted.
Consider the following line of console output, excerpted from among other lines of output. Which one of the commands produced it?
/dev/hda8 1.9G 559M 1.2G 30% /home
du -s
du -k
df -h
df -k
df -m
Which one of the following is true about the LILO boot loader?
It can start the Windows NT Loader.
It is started using the lilo command.
It is the only boot loader available for Linux.
It can start multiple Linux kernels, but no foreign operating systems.
It resides entirely in the boot sector.
Which one of the following statements correctly describes the >
and >>
symbols in the context of the bash shell?
>
appends standard output to an existing file, and >>
writes standard output to a new file.
>
writes standard output to a new file, and >>
appends standard output to an existing file.
>
writes standard error to a new file, and >>
appends standard error to an existing file.
>
pipes standard output to a new file, and >>
pipes standard output to an existing file.
>
pipes standard output to an existing file and >>
pipes standard error to a new file.
What is the correct syntax to remove mypkg entirely from a Debian GNU/Linux system, including configuration files? Select one.
dpkg -r mypkg
dpkg --remove mypkg
dpkg --kill mypkg
dpkg -R mypkg
dpkg --purge mypkg
Your system's FontPath
directives include only one entry:
unix/:-1
Which of the following is true? Select one.
Error -1 has occurred during X startup
Only the default font will be available to applications
An X font server is to be used
An X font server failed to initialize
No fonts were found by XFree86 or by a font server
How do you use dpkg to verify the status of an installed package mypkg? Select one.
dpkg -s mypkg
dpkg -S mypkg
dpkg -stat mypkg
dpkg --stat mypkg
dpkg --Status mypkg
Which of the following statements is true about an X server? Select one.
An X server is a high-performance system offering graphical programs over a network.
An X server sends its graphical output to a window manager.
An X server is under the control of a window manager.
A window manager is under the control of an X server.
A window manager is also known as an X server.
What are the two interrupts usually associated with a PC's onboard serial interface?
How can you query the RPM database for a list of all installed RPM packages? Select one.
rpm -q
rpm -qa
rpm -a
rpm -al
rpm -qal
Which pair of dpkg options are equivalent and what do they do? Select one.
-C and --configure; they reconfigure an unpackaged package.
-C and --clear-avail; they erase existing information about what packages are available.
-A and --audit; they update information about what packages are available.
-C and --audit; they provide resource consumption information on installed packages.
-C and --audit; they search for partially installed packages.
What will happen when rpm is launched as follows?
rpm -Uvh file
The RPM file will be verified.
An installed package may be upgraded with the version in file, with verbose output.
An installed package may be upgraded with the version in file, with verbose output and hash marks indicating progress.
An error will occur because a major mode is not specified.
An error will occur because no file options were specified.
How are changes to the system BIOS made? Select one.
Using linuxconf.
By manually editing text files.
Using the lilo command.
At boot time using system-specific menus.
At boot time using LILO commands.
When using xdm, which of the following files can be used to start a window manager? Select one.
Xservers
Xaccess
xdm-config
Xsession
Xsetup_0
When partitioning a disk with more than 1024 cylinders, which of the following could affect the system's ability to boot? Select all that apply.
Location of LILO on disk.
Location of /boot on disk.
Location of /var on disk.
Disk transfer rate.
Disk seek time.
Which of the following is a reasonable size for a swap partition for a Linux workstation with 128 MB RAM? Select one.
1 KB
0.5 MB
100 MB
5 GB
10 GB
What is XDMCP, and how is it used? Select one.
An X utility, used to copy files between a host and an X terminal.
An X utility, used to configure XDM.
An X utility, used to configure IP addresses on X terminals on the network.
An X protocol, used to discover/listen for X terminals on the network.
An X protocol, used to exchange graphics information between X clients and X servers over the network.
How many target devices can be added to an 8-bit SCSI-2 bus? Select one.
6
7
8
15
16
What is the startx command? Select one.
A script included with XFree86 to make startup user friendly.
A script used to start xdm.
A compiled binary program that directly launches the X server.
A configuration file created by X configuration tools such as XF86Config.
A script originated by Linux distributors to tailor X startup to their particular X implementation.
How can you obtain a list of files contained in an .rpm file? Select one.
rpm -q f ile
rpm -i file
rpm -ql file
rpm -qlp file
rpm -qal file
Which of the following accurately describes the contents of the xdisp:1.0 DISPLAY
environment variable? Select one.
System xdisp
is to send X programs to the first display of the local X server.
System xdisp
is to receive X programs on the first display of its X server.
System xdisp
is to receive X programs on the second display of its X server.
Local program xdisp is to use the second display of the local X server.
Local program xdisp is to use the second display of any available X terminal.
Which file contains information on the I/O port assignments in use? Select one.
/dev/ioports
/etc/ioports
/etc/sysconfig/ioports
/etc/proc/ioports
/proc/ioports
Why might an administrator use the --force option for rpm?
To overwrite a previously installed package.
To overwrite a Debian package.
To prevent confirmation messages.
To force the deletion of installed packages.
To force the deletion of package dependencies.
Which of the following commands cannot be used to exit from vi when in command mode? Select one.
ZZ
:x
:q
:q!
:bye
Which is not a valid dpkg installation command? Select one.
dpkg -i
package_file
dpkg -iL
package_file
dpkg -iR
package_dir
dpkg -iG
package_file
dpkg -iE
package_file
Which of the following is the text file that contains directories where the dynamic linker should look for libraries? Select one.
ld.so.conf
conf.ld.so
ld.so.cache
so.config
configld