LPI Level 1 Exam 101, Junior Level Linux Certification, Part 1 of 2

QUESTION NO: 1

Which command will display messages from the kernel that were output during the normal bootup sequence?

Answer: dmesg, /bin/dmesg

QUESTION NO: 2

What is the process ID number of the init program?

A. -1

B. 0

C. 1

D. It is different with each reboot.

E. It is set to the current run level.

Answer: C

QUESTION NO: 3

The system configuration file named _______ is commonly used to set the default runlevel. (Please provide the file name with full path information)

Answer: /etc/inittab

QUESTION NO: 4

Which file in the /proc filesystem lists parameters passed from the bootloader to the kernel?

Answer: cmdline, /proc/cmdline

QUESTION NO: 5

The message "Hard Disk Error" is displayed on the screen during Stage 1 of the GRUB boot process. What does this indicate?

A. The kernel was unable to execute /bin/init

B. The next Stage cannot be read from the hard disk because GRUB was unable to determine the size and geometry of the disk

C. One or more of the filesystems on the hard disk has errors and a filesystem check should be run

D. The BIOS was unable to read the necessary data from the Master Boot Record to begin the boot process

Answer: B

QUESTION NO: 6

Which of the following commands will load a kernel module along with any required dependency modules?

A. depmod

B. insmod

C. modprobe

D. module_install

E. loadmod

Answer: C

QUESTION NO: 7

During a system boot cycle, what is the program that is run after the BIOS completes its tasks?

A. The bootloader

B. The inetd program

C. The init program

D. The kernel

Answer: A

QUESTION NO: 8

You are having some trouble with a disk partition and you need to do maintenance on this partition but your users home directories are on it and several are logged in. Which command would disconnect the users and allow you to safely execute maintenance tasks?

A. telinit 1

B. shutdown -r now

C. killall -9 inetd

D. /bin/netstop --maint

E. /etc/rc.d/init.d/network stop

Answer: A

QUESTION NO: 9

You suspect that a new ethernet card might be conflicting with another device. Which file should you check within the /proc tree to learn which IRQs are being used by which kernel drivers?

Answer: interrupts, /proc/interrupts

QUESTION NO: 10

Which configuration file should be modified to disable the ctrl-alt-delete key combination?

A. /etc/keys

B. /proc/keys

C. /etc/inittab

D. /proc/inittab

E. /etc/reboot

Answer: C

QUESTION NO: 11

The system is having trouble and the engineer wants to bypass the usual /sbin/init start up and run /bin/sh. What is the usual way to pass this change to the kernel from your boot loader?

A. Start in runlevel 1.

B. Pass init=/bin/sh on the kernel parameter line.

C. Pass /bin/sh on the kernel parameter line.

D. Pass start=/bin/sh on the kernel parameter line.

Answer: B

QUESTION NO: 12

The USB device filesystem can be found under /proc/______/usb/. (Please fill in the blank with the single word only)

Answer: bus

QUESTION NO: 13

Which command displays the contents of the Kernel Ring Buffer on the command line? (Provide only the command name without any options or path information)

Answer: dmesg, /bin/dmesg

QUESTION NO: 14

Which of the following commands will write a message to the terminals of all logged in users?

A. bcast

B. mesg

C. print

D. wall

E. yell

Answer: D

QUESTION NO: 15

You are having some trouble with a disk partition and you need to do maintenance on this partition but your users home directories are on it and several are logged in. Which command would disconnect the users and allow you to safely execute maintenance tasks?

A. halt 1

B. init 1

C. logout --all now

D. runlevel 1

E. shutdown --maintenance now

Answer: B

Topic 2, Linux Installation and Package Management

QUESTION NO: 1

Which of the following commands can be used to perform a full text search on all available packages on a Debian system?

A. apt

B. apt-cache

C. apt-get

D. apt-search

E. dpkg

Answer: B

QUESTION NO: 2

To what environment variable will you assign or append a value if you need to tell the dynamic linker to look in a build directory for some of a program's shared libraries?

A. LD_LOAD_PATH

B. LD_LIB_PATH

C. LD_LIBRARY_PATH

D. LD_SHARE_PATH

E. LD_RUN_PATH

Answer: C

QUESTION NO: 3

To prevent users from being able to fill up the / partition, the ____________ directory should be on a separate partition if possible because it is world writeable.

Answer: /tmp, tmp

QUESTION NO: 4

Which RPM command will output the name of the package which installed the file /etc/exports?

A. rpm -F /etc/exports

B. rpm -qf /etc/exports

C. rpm -Kl /etc/exports

D. rpm -qp /etc/exports

E. rpm -qi /etc/exports

Answer: B

QUESTION NO: 5

In which directory must definition files be placed to add additional repositories to yum?

QUESTION NO: 11

B. --remove only removes the program, --purge only removes the config files

C. --remove removes a package, --purge also removes all packages dependent on it

D. --remove removes only the package file itself, --purge removes all files related to the package

Answer: A

QUESTION NO: 12

How can you update a package only if an earlier version is currently installed on the system?

A. rpm --update rpmname

B. rpm -U rpmname

C. rpm -F rpmname

D. rpm --force rpmname

E. rpm -u rpmname

Answer: C

QUESTION NO: 13

You want to preview where the package file, apache-xml.i386.rpm, will install its files before installing it. What command do you issue?

A. rpm -qp apache-xml.i386.rpm

B. rpm -qv apache-xml.i386.rpm

C. rpm -ql apache-xml.i386.rpm

D. rpm -qpl apache-xml.i386.rpm

Answer: D

QUESTION NO: 14

What command will uninstall a package but leave its configuration files in case a package is re-installed?

A. none, no command will do this

B. dpkg -s pkgname

C. dpkg -L pkgname

D. dpkg -P pkgname

E. dpkg -r pkgname

Answer: E

QUESTION NO: 15

Which file should be edited to select the network locations from which Debian installation package files are loaded?

A. /etc/dpkg/dpkg.cfg

B. /etc/apt/apt.conf

C. /etc/apt/apt.conf.d

D. /etc/apt/sources.list

E. /etc/dpkg/dselect.cfg

Answer: D

QUESTION NO: 16

What option, when passed to the yum command, will update the entire system? (Specify ONLY the option name with no additional parameters)

Answer: update, upgrade

QUESTION NO: 17

Which command will disable paging and swapping on a device? (Provide only the command with no additional options or parameters)

Answer: swapoff, /sbin/swapoff

QUESTION NO: 18

What command will print the shared libraries for the file /usr/lib/libpng12.so? (Provide the full command with library name but without any other options or parameters)

Answer: /usr/bin/ldd /usr/lib/libpng12.so, ldd /usr/lib/libpng12.so

QUESTION NO: 19

Which of the following statements is a TRUE difference between GRUB Legacy and GRUB 2?

A. GRUB 2 no longer requires a configuration file.

B. Partition numbers start at 0 in GRUB Legacy and 1 in GRUB 2.

C. grub-mkconfig only works with GRUB Legacy if the --version 1 option is used.

D. The configuration file menu.lst (and grub.conf) have been replaced with grub.config.

Answer: B

QUESTION NO: 20

The GRUB_TIMEOUT parameter specifies a timeout period when booting in what unit of time?

A. milliseconds

B. tenths of seconds

C. seconds

D. minutes

Answer: C

QUESTION NO: 21

Which command is used to query information about the available packages on a Debian system?

A. apt-cache

B. apt-get

C. apt-search

D. dpkg

E. dpkg-search

Answer: A

QUESTION NO: 22

Typically, which top level system directory is used for files and data that change regularly while the system is running and are to be kept between reboots? (Specify only the top level directory)

Answer: /var, /var/, var, var/

Topic 3, GNU and Unix Commands

QUESTION NO: 1

Which of the following explanations are valid reasons to run a command in the background of your shell?

A. The command does not need to execute immediately.

B. The command has to run immediately but the user needs to log out.

C. The system is being shut down and the command needs to restart execution immediately after the reboot.

D. The command can run at a lower priority than normal commands run on the command line.

Answer: B

QUESTION NO: 2

What does the + symbol mean in the following grep regular expression:

grep '^d[aei]\+d$' /usr/share/dict/words

A. Match the preceding character set ([aei]) one or more times.

B. Match the preceding character set ([aei]) zero or more times.

C. Match the preceding character set ([aei]) zero or one times.

D. Match a literal + symbol.

Answer: A

QUESTION NO: 3

While editing a file in vi, the file changes due to another process. Without exiting vi, how can the file be reopened for editing with the new content?

A. :r

B. :n

C. :w

D. :e

Answer: D

QUESTION NO: 4

Given the following output:

prompt> myapp

[1]+ Stopped myapp

prompt>

Which of the following commands will resume executing the stopped process and make it the current job?

A. bg myapp

B. continue myapp

C. exec myapp

D. fg myapp

E. myapp &

Answer: D

QUESTION NO: 5

When should grep -F or the fgrep command be used to search the content of text files?

A. When files need to be searched that contain non-ASCII text.

B. When only the presence of the search pattern needs to be reported and not every line that matches the search.

C. When the text being searched for does not contain any regular expression patterns.

D. When the text files will be searched multiple times. Subsequent calls to fgrep will run faster.

Answer: C

QUESTION NO: 6

In compliance with the FHS, in which of the directories are man pages typically found?

A. /usr/share/man

B. /opt/man

C. /usr/doc/

D. /var/pkg/man

E. /usr/local/man

Answer: A

QUESTION NO: 7

In the command foo < bar | foobar, which ONE of the following statements is correct?

A. The stdout from the command foobar is saved to the file foo.

B. The stdout from the command foo is saved to the file foobar.

C. The command foobar receives its stdin from the stderr of foo.

D. The command foobar receives its stdin from the stdout of foo.

E. The command bar receives its stdin from the contents of the file foobar.

Answer: D

QUESTION NO: 8

You have created a long letter and after you are done you notice that you used the name "Bob" many times but you forgot to capitalize it in many instances. Which command would replace "bob" with "Bob" in all instances and generate a new letter for printing?

A. sed '/bob/Bob' letter > newletter

B. sed s/bob/Bob/ letter < newletter

C. sed 's/bob/Bob' letter > newletter

D. sed 's/bob/Bob/g' letter > newletter

E. sed 's/bob, Bob/' letter > newletter

Answer: D

QUESTION NO: 9

You are writing text in vi. Now you want to save your changes and exit. Which TWO sequence of inputs will accomplish this?

A. esc ZZ

B. ctrl :w!

C. esc zz

D. esc :wq!

E. ctrl XX

Answer: A, D

QUESTION NO: 10

Bob accidentally created the subdirectory \bobsdir in his home directory. He tried to remove the subdirectory with the command rmdir \bobsdir only to receive the error, "No such file or directory." . Which command will remove the directory?

A. rmdir '~bob/\bobsdir'

B. rmdir "~bob/\bobsdir"

C. rmdir ~bob/'bobsdir'

D. rmdir ~bob/\bobsdir

E. rmdir ~bob/\\bobsdir

Answer: E

QUESTION NO: 11

Pressing the Ctrl-C combination on the keyboard while a command is executing in the foreground sends which of following signal codes?