Linux

Ace your homework & exams now with Quizwiz!

You've just installed Linux on a new computer with a single SATA hard disk. What device identifier will refer to the disk?

/dev/sda or /dev/hda

A new Linux administrator plans to create a system with separate /home, /usr/local, and /etc partitions. Which of the following best describes this configuration?<br>A. The system won't boot because /etc contains configuration files necessary to mount non-root partitions.<br>B. The system will boot, but /usr/local won't be available because mounted partitions must be mounted directly off their parent partition, not in a subdirectory.<br>C. The system will boot only if the /home partition is on a separate physical disk from the /usr/local partition.<br>D. The system will boot and operate correctly, provided each partition is large enough for its intended use.

A

A system administrator types the following command:<br># shutdown -c<br>What is the effect of this command?<br>A. A previously scheduled shutdown is cancelled.<br>B. The system shuts down and reboots immediately.<br>C. The system shuts down and halts immediately.<br>D. The system asks for confirmation and then shuts down.

A

To use dpkg to remove a package called theprogram, including its configuration files, which of the following commands would you issue?<br>A. dpkg -P theprogram <br>B. dpkg -p theprogram <br>C. dpkg -r theprogram <br>D. dpkg -r theprogram-1.2.3-4.deb

A

Which of the following commands creates a display of processes, showing the parent/child relationships through links between their names?<br>A. ps -forest <br>B. ps aux <br>C. ps -e <br>D. All of the above

A

Which of the following commands will extract the contents of the myfonts.rpm file into the current directory?<br>A.rpm2cpio myfonts.rpm | cpio -i -make-directories <br>B.rpm2cpio myfonts.rpm > make-directories <br>C.rpm -e myfonts.rpm <br>D.alien -to-extract myfonts.rpm

A

Which of the following commands will print lines from the file world.txt that contain matches to changes and changed?<br>A. grep change[ds] world.txt , B. sed change[d-s] world.txt , C. od "change'd|s'" world.txt , D. cat world.txt changes changed

A

Which of the following file-location commands is likely to take the most time to find a file that may be located anywhere on the computer (assuming the operation succeeds)?<br>A. The find command.<br>B. The locate command. <br>C. The whereis command. <br>D. They're all equal in speed.

A

Which of the following pieces of information can df not report?<br>A. How long the filesystem has been mounted<br>B. The number of inodes used on an ext3fs partition <br>C. The filesystem type of a partition<br>D. The percentage of available disk space used on a partition

A

You want to create a link from your home directory on your hard disk to a directory on a CD-ROM drive. Which of the following types of links might you use?<br>A. Only a symbolic link. <br>B. Only a hard link.<br>C. Either a symbolic or a hard link.<br>D. None of the above; such links aren't possible under Linux.

A

You want to discover the sizes of several dot files in a directory. Which of the following commands might you use to do this?<br>A. ls -la <br>B. ls -p <br>C. ls -R <br>D. ls -d

A

What is wrong with the following /etc/fstab file entry? (Select all that apply.)<br>/dev/hda8 nfs default 0 0<br>A. The entry is missing a mount point specification. <br>B. All /etc/fstab fields should be separated by commas. <br>C. The default option may only be used with ext2 filesystems.<br>D. /dev/hda8 is a disk partition, but nfs indicates a network filesystem.

A and D

Which of the following commands would you type to update the unzip program on a Fedora system to the latest version? (Select all that apply.)<br>A. yum update unzip <br>B. yum upgrade unzip <br>C. yum -u unzip <br>D. yum -U unzip

A, B

From Vi's command mode, you want to enter insert mode. How might you do this? (Select all that apply.)<br>A. Type R.<br>B. Type i.<br>C. Type a.<br>D. Type :.

A, B, C

Which runlevels are reserved by init for reboot, shutdown, and single-user mode purposes? (Select all that apply.)<br>A. 0<br>B. 1<br>C. 5<br>D. 6

A, B, D

What filesystem options might you specify in /etc/fstab to make a removable disk (USB pen drive, Zip disk, floppy disk, and so on) user-mountable? (Select all that apply.)<br>A. user <br>B. users <br>C. owner <br>D. owners

A, B, and C

Which files contain essential system information such as IRQs, DMA channels, and I/O addresses? (Select all that apply.)<br>A. /proc/ioports <br>B. /proc/ioaddresses <br>C. /proc/dma <br>D. /proc/interrupts

A, C, and D

You type mkdir one/two/three and receive an error message that reads, in part, No such file or directory. What can you do to overcome this problem? (Select all that apply.)

Add the --parents parameter to the mkdir command. <br>Issue three separate mkdir commands: mkdir one, then mkdir one/two, and then mkdir one/two/three.

What is the preferred method of adding a directory to the library path for all users?

Add the directory to the /etc/ld.so.conf file, and then type ldconfig.

How many commands can you pipe together at once?

An arbitrary number

Typing fdisk -l /dev/hda on a Linux computer produces a listing of four partitions: /dev/hda1, /dev/hda2, /dev/hda5, and /dev/hda6. Which of the following is true?<br>A. The disk contains two primary partitions and two extended partitions. <br>B. Either /dev/hda1 or /dev/hda2 is an extended partition. <br>C. The partition table is corrupted; there should be a /dev/hda3 and a /dev/hda4 before /dev/hda5.<br>D. If you add a /dev/hda3 with fdisk, /dev/hda5 will become /dev/hda6 and /dev/hda6 will become /dev/hda7.

B

Which of the following /etc/fstab entries will mount /dev/sdb2 as the /home directory at boot time?<br>A. /dev/sdb2 reiserfs /home defaults 0 0 <br>B. /dev/sdb2 /home reiserfs defaults 0 0 <br>C. /home reiserfs /dev/sdb2 noauto 0 0 <br>D. /home /dev/sdb2 reiserfs noauto 0 0

B

Which of the following best summarizes the differences between DOS's FDISK and Linux's fdisk?<br>A. Linux's fdisk is a simple clone of DOS's FDISK but written to work from Linux rather than from DOS or Windows.<br>B. The two are completely independent programs that accomplish similar goals, although Linux's fdisk is more flexible.<br>C. DOS's FDISK uses GUI controls, whereas Linux's fdisk uses a command-line interface, but they have similar functionality.<br>D. Despite their similar names, they're completely different tools—DOS's FDISK handles disk partitioning, whereas Linux's fdisk formats floppy disks.

B

Which of the following commands can be used to summarize the quota information about all filesystems?<br>A. repquota <br>B. repquota -a <br>C. quotacheck <br>D. quotacheck -a

B

Which of the following regular expressions will match the strings dig and dug but not dog?<br>A. d.g , B. d[iu]g , C. d[i-u]g , D. di*g

B

You want to track down all the files in /home that are owned by karen. Which of the following commands will do the job?<br>A. find /home -uid karen <br>B. find /home -user karen <br>C. locate /home -username karen <br>D. locate /home karen

B

What are common IRQs for serial ports? (Select all that apply.)<br>A. 1<br>B. 3<br>C. 4<br>D. 16

B, C

You type the following command:<br>$ runlevel<br>5 3<br>What can you tell about your runlevel status? (Select all that apply.)<br>A. The current runlevel is 5.<br>B. The current runlevel is 3.<br>C. The previous runlevel is 5.<br>D. The previous runlevel is 3.

B, C

Which of the following commands will number the lines in aleph.txt? (Select all that apply.)<br>a. fmt aleph.txt, b. nl aleph.txt , c. cat -b aleph.txt , d. cat -n aleph.txt

B, C, and D

Which of the following are restrictions on ordinary users' abilities to run renice? (Select all that apply.)<br>A. Users may not modify the priorities of processes that are already running. <br>B. Users may not modify the priorities of other users' processes. <br>C. Users may not decrease the priority (that is, increase the priority value) of their own processes.<br>Users may not increase the priority (that is, decrease the priority value) of their D. D. own processes.

B, D

Which of the following commands are commonly used to create archive files? (Select all that apply.)<br>A. restore <br>B. tar <br>C. tape <br>D. cpio

B, D

Which of the following commands will change all occurrences of dog in the file animals.txt to mutt in the screen display?<br>A. sed -s "dog" "mutt" animals.txt , B. sed -s "dog" "mutt" animals.txt , C. sed 's/dog/mutt/g' animals.txt , D. cat animals.txt | grep -c "dog" "mutt"

C

Which of the following describes a difference between apt-get and dpkg?<br>A. apt-get provides a GUI interface to Debian package management; dpkg doesn't.<br>B. apt-get can install tarballs in addition to Debian packages; dpkg can't.<br>C. apt-get can automatically retrieve and update programs from Internet sites; dpkg can't. <br>D. apt-get is provided only with the original Debian distribution, but dpkg comes with Debian and its derivatives.

C

Which of the following options is used with fsck to force it to use a particular filesystem type?<br>A. -A <br>B. -N <br>C. -t <br>D. -C

C

Typing ls -ld wonderjaye reveals a symbolic file mode of drwxr-xr-x. Which of the following are true? (Select all that apply.)<br>A. wonderjaye is a symbolic link.<br>B. wonderjaye is an executable program.<br>C. wonderjaye is a directory.<br>D. wonderjaye may be read by all users of the system.

C, D

What programs might you use to learn what your system's load average is? (Select all that apply.)<br>A. ld <br>B. load <br>C. top <br>D. uptime

C, D

Which two of the following commands are equivalent to one another? (Select two.)<br>A. nice -value 10 crunch <br>B. nice -n −10 crunch <br>C. nice −10 crunch <br>D. nice crunch

C, D

To access files on a USB pen drive, you type mount /dev/sdc1 /media/pen as root. Which types of filesystems will this command mount?<br>A. Ext2fs<br>B. FAT<br>C. HFS <br>D. All of the above

D

Which of the following commands may not be used instead of shutdown in certain circumstances?<br>A. reboot <br>B. halt <br>C. poweroff <br>D. takedown

D

Which of the following commands would you type to enable world read across access to the file myfile.txt? (Assume that you're the owner of myfile.txt.)<br>A. chmod 741 myfile.txt <br>B. chmod 0640 myfile.txt <br>C. chmod u+r myfile.txt <br>D. chmod o+r myfile.txt

D

Which of the following directories is most likely to be placed on its own hard disk partition?<br>A. /bin <br>B. /sbin <br>C. /mnt <br>D. /home

D

Which of the following is not an advantage of a source package over a binary package?<br>A.A single source package can be used on multiple CPU architectures. <br>B.By recompiling a source package, you can sometimes work around library incompatibilities. <br>C.You can modify the code in a source package, altering the behavior of a program.<br>D.Source packages can be installed more quickly than binary packages can.

D

Which of the following is the LILO boot loader configuration file?<br>A. /dev/lilo <br>B. The MBR<br>C. /boot/lilo/lilo.conf <br>D. /etc/lilo.conf

D

Which of the following umask values will result in files with rw-r----- permissions?<br>A. 640<br>B. 210<br>C. 022<br>D. 027

D

You want to move a file from your hard disk to a USB pen drive. Which of the following is true?<br>A. You'll have to use the --preserve option to mv to keep ownership and permissions set correctly.<br>B. The mv command will adjust filesystem pointers without physically rewriting data if the pen drive uses the same filesystem type as the hard disk partition. <br>C. You must use the same filesystem type on both media to preserve ownership and permissions. <br>D. The mv command will delete the file on the hard disk after copying it to the pen drive.

D

You've received a tarball called data79.tar from a colleague, but you want to check the names of the files it contains before extracting them. Which of the following commands would you use to do this?<br>A. tar uvf data79.tar <br>B. tar cvf data79.tar <br>C. tar xvf data79.tar <br>D. tar tvf data79.tar

D

How should you configure a system that uses Yum to access an additional Yum software repository?

Download a package from the repository site and install it with RPM, or place a configuration file from the repository site in the /etc/yum.repos.d directory.

Which of the following commands is implemented as an internal command in bash? Cat, echo, tee, or sed?

Echo

The string root (hd1,5) appears in your /boot/grub/menu.lst file. What does this mean?

GRUB looks for files on the sixth partition of the second disk.

What can the type command do that whereis can't do?

Identify a command as an alias, internal command, or external command

How would you remove two lines of text from a file using Vi?

In Vi, dd is the command-mode command that deletes lines. Preceding this command by a number deletes that number of lines. Although yy works similarly, it copies (yanks) text rather than deleting it. Option C works in many more modern text editors, but not in Vi. Option D works in Emacs and similar text editors, but not in Vi.

What does the following command accomplish?<br># mkfs -t ext2 /dev/sda4

It creates a new ext2 filesystem on /dev/sda4, overwriting any existing filesystem and data.

What does the pwd command accomplish?

It prints the name of the working directory.

Which is true of using both RPM and Debian package management systems on one computer?

It's generally inadvisable because the two systems don't share installed-file database information.

What does runlevel 4 do?

Its purpose isn't standardized, so it can be used for anything you like.

What is an advantage of a journaling filesystem over a conventional (non-journaling) filesystem?

Journaling filesystems require shorter disk checks after a power failure or system crash.

Where might the BIOS find a boot loader?

MBR

You type jobs at a bash command prompt and receive a new command prompt with no intervening output. What can you conclude?

No background processes are running that were launched from the shell you're using.

What mount point should you associate with swap partitions?

None. Swap partitions aren't mounted in the way filesystems are, so they have no associated mount points.

When should programs be configured SUID root?

Only when they require root privileges to do their job.

How do you exit Vi's insert mode in order to type command-mode commands?

Press the Esc key.

You see the usrquota and grpquota options in the /etc/fstab entry for a filesystem. What is the consequence of these entries?

Quota support will be available if it's compiled into your kernel, but you must activate it with the quotaon command.

You type a command into bash and pass a long filename to it, but after you enter the command, you receive a File not found error message because of a typo in the filename. How might you proceed?

Retype the command, and be sure you type the filename correctly, letter by letter; Retype the command, but press the Tab key after typing a few letters of the long filename to ensure that the filename is entered correctly; or Press the Up arrow key, and use bash's editing features to correct the typo.

What is the effect of the following command?<br>$ myprog &> input.txt

Standard output and standard error from myprog are written to input.txt.

You've installed a commercial spreadsheet program called WonderCalc on a workstation. In which of the following directories are you most likely to find the program executable file?<br>/usr/sbin <br>/etc/X11 <br>/bin <br>/opt/wcalc/bin

The /opt directory tree exists to hold programs that aren't a standard part of a Linux distribution, such as commercial programs. These programs should install in their own directories 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 spreadsheet program.

How do the > and >> redirection operators differ?

The > operator creates a new file or overwrites an existing one; the >> operator creates a new file or appends to an existing one.

As root, you type apt-get update on a Debian system. What should be the effect of this command?

The APT utilities retrieve information about the latest packages available so that you may install them with subsequent apt-get commands.

What tool would you use to disable a motherboard's sound hardware if you don't want to use it?

The BIOS

You want to use /media/cdrom to access your CD-ROM drive, so you insert a CD-ROM into the drive and type mount /media/cdrom /dev/cdrom as root. You receive the error message /media/cdrom is not a block device. Why did this happen?

The command reverses the order of the CD-ROM device file and the mount point; it should be mount /dev/cdrom /media/cdrom.

You discover that an MBR hard disk has partitions with type codes of 0×0f, 0×82, and 0×83. Assuming these type codes are accurate, what can you conclude about the disk?

The disk holds a partial or complete Linux system.

What is the effect of the following command?<br>$ pr report.txt | lpr

The file report.txt is formatted for printing and sent to the lpr program.

What can you conclude from the following interaction?<br>$ which man<br>/usr/bin/man

The first instance of the man program, in path search order, is in /usr/bin.

An administrator types the following command on an RPM-based Linux distribution:<br># rpm -ivh megaprog.rpm<br>What is the effect of this command?

The megaprog.rpm package, if it exists, is valid, and isn't already installed, is installed on the system.

A. In Vi's command mode, you type :q!. What is the effect?

The program terminates without saving your work.

In an xterm window launched from your window manager, you type exec gedit. What will happen when you exit from the gedit program?

The xterm window will close.

Which of the following statements is true about binary RPM packages that are built for a particular distribution?

They can often be used on another RPM-based distribution for the same CPU architecture, but this isn't guaranteed.

What is the purpose of udev?

To manage the /dev directory tree

A user types kill −9 11287 at a bash prompt. What is the probable intent, assuming the user typed the correct command?

To terminate a misbehaving or hung program with process ID 11287

What is the surest way to run a program (say, myprog) that's located in the current working directory?

Type ./ followed by the program name: ./myprog.

After booting, one of your hard disks doesn't respond. What might you do to find out what's gone wrong?

Type dmesg | less, and peruse the output for disk-related messages.

You run Linux's fdisk and modify your partition layout. Before exiting the program, you realize that you've been working on the wrong disk. What can you do to correct this problem?

Type q to exit fdisk without saving changes to disk.

What is the minimum safe procedure for removing a USB flash drive, mounted from /dev/sdb1 at /media/usb, from a Linux computer?

Type umount /media/usb, wait for the command to return and disk activity lights to stop, and then unplug the drive.

How does man display information by default on most Linux systems?

Using the less pager

You use top to examine the CPU time being consumed by various processes on your system. You discover that one process, dfcomp, is consuming more than 90 percent of your system's CPU time. What can you conclude?

Very little; dfcomp could be legitimately consuming that much CPU time or it could be an unauthorized or malfunctioning program.

What is an advantage of Vi over Emacs?

Vi is smaller and so can fit on compact emergency systems and embedded devices.

You prefer the look of GTK+ widgets to Qt widgets, so you want to substitute the GTK+ libraries for the Qt libraries on your system. How would you do this?

You can't easily do this; libraries can't be arbitrarily exchanged for one another. You would need to rewrite all the Qt-using programs to use GTK+.

You type echo $PROC, and the computer replies Go away. What does this mean?

You, one of your configuration files, or a program you've run has set the $PROC environment variable to Go away.

What command would you type to obtain a list of all installed packages on a Debian system?

apt-cache pkgnames

What command would you type (as root) to change the ownership of somefile.txt from ralph to tony?

chown tony somefile.txt

You've received an ASCII text file (longlines.txt) that uses no carriage returns within paragraphs but two carriage returns between paragraphs. The result is that your preferred text editor displays each paragraph as a very long line. How can you reformat this file so that you can more easily edit it (or a copy)?

fmt longlines.txt > longlines2.txt

You want to run an interactive script, gabby, which produces a lot of output in response to the user's inputs. To facilitate future study of this script, you want to copy its output to a file. How might you do this?

gabby | tee gabby-out.txt

Which command is used to install GRUB into the MBR of your first ATA hard drive?

grub-install /dev/hda

What line in /etc/inittab would indicate that your default runlevel is 5?

id:5:initdefault:

You want to store the standard output of the ifconfig command in a text file (file.txt) for future reference, and you want to wipe out any existing data in the file. How can you do so?

ifconfig > file.txt

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?

image=/boot/bzImage-2.6.26

What is the first program that the Linux kernel runs once it's booted in a normal boot process?

init

You want to boot a Linux system into single-user mode. What might you type at a LILO boot: prompt to accomplish this task?

linux 1

What program would you use to display the end of a configuration file?

tail

You want to change to single-user mode on a running system. What command might you use to do this?

telinit 1

A text-mode program, verbose, prints a lot of spurious "error" messages to standard error. How might you get rid of those messages while still interacting with the program?

verbose 2> /dev/null


Related study sets

CCNA V7 - Chapter 9 - Address Resolution - Module Quiz

View Set

PrepU Chapter 31: Hypertension (Exam 1)

View Set