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?

Answer: /etc/yum.repos.d, /etc/yum.repos.d/, yum.repos.d, yum.repos.d/

QUESTION NO: 6

An administrator has issued the following command:

grub-install --root-directory=/custom-grub /dev/sda

In which directory will new configuration files be found? (Provide the full directory path only without the filename)

Answer: /custom-grub/boot/grub/, /custom-grub/boot/grub

QUESTION NO: 7

The dpkg-____ command will ask configuration questions for a specified package, just as if the package were being installed for the first time.

Answer: reconfigure

QUESTION NO: 8

What is the name of the main configuration file for GRUB? (Please specify the file name with no path information)

Answer: menu.lst, grub.conf, grub.cfg

QUESTION NO: 9

Which of the following commands can be used to enable a file for paging and swapping?

A. mkswap

B. swapon

C. inswap

D. modswap

Answer: B

QUESTION NO: 10

Which of the following apt-get commands will install the newest versions of all currently installed packages without removing any packages or installing new packages that are not already installed?

A. auto-update

B. upgrade

C. dist-upgrade

D. install

E. update

Answer: B

QUESTION NO: 11

What is the difference between the --remove and the --purge action with the dpkg command?

A. --remove removes the program, --purge also removes the config files

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?

A. 1 (SIGHUP)

B. 2 (SIGINT)

C. 3 (SIGQUIT)

D. 9 (SIGKILL)

E. 15 (SIGTERM)

Answer: B

QUESTION NO: 12

Which directory contains additional information about installed packages?

A. /usr/share/documentation

B. /usr/local/share/documentation

C. /usr/local/doc

D. /usr/share/doc

E. /usr/packages/doc

Answer: D

QUESTION NO: 13

What is the default process priority when a process is started using the nice command?

A. -10

B. 10

C. 20

D. 0

Answer: B

QUESTION NO: 14

Which of the following commands will NOT execute the bash script /usr/local/bin/runme.sh?

A. source /usr/local/bin/runme.sh

B. . /usr/local/bin/runme.sh

C. /bin/bash /usr/local/bin/runme.sh

D. /usr/local/bin/runme.sh

E. run /usr/local/bin/runme.sh

Answer: E

QUESTION NO: 15

Which of the following commands will NOT update the Modify timestamp on the file /tmp/myfile.txt?

A. file /tmp/myfile.txt

B. echo "Hello" >/tmp/myfile.txt

C. sed -ie "s/1/2/" /tmp/myfile.txt

D. echo -n "Hello" >/tmp/myfile.txt

E. touch /tmp/myfile.txt

Answer: A

QUESTION NO: 16

The priority of any process can range from -20 to ________. (Provide only the numerical value)

Answer: 19, +19

QUESTION NO: 17

Which of the following commands will print important system information such as the kernel version and machine hardware name?

A. sysinfo

B. uname

C. lspci

D. arch

E. info

Answer: B

QUESTION NO: 18

Which of the following commands will change all CR-LF pairs in an imported text file, userlist.txt, to Linux standard LF characters and store it as newlist.txt?

A. tr '\r\n' '' < userlist.txt > newlist.txt

B. tr -c '\n\r' '' < newlist.txt > userlist.txt

C. tr -d '\r' < userlist.txt > newlist.txt

D. tr '\r' '\n' userlist.txt newlist.txt

E. tr -s '^M' '^J' userlist.txt newlist.txt

Answer: C

QUESTION NO: 19

What command will print a list of usernames (first column) and their corresponding user id (uid, third column) from /etc/passwd?

A. cut -d: -f1,3 /etc/passwd

B. chop -c 1,3 /etc/passwd

C. tac 1-3 /etc/passwd

D. fmt -u /etc/passwd

Answer: A

QUESTION NO: 20

What is the default action of the split command on an input file?

A. It will break the file into new files of 1,024 byte pieces each.

B. It will break the file into new files of 1,000 line pieces each.

C. It will break the file into new files of 1,024 kilobyte pieces each.

D. It will break the file into new files that are no more than 5% of the size of the original file.

Answer: B

QUESTION NO: 21

Which of the following commands can be used to create a new file that is 100kB in size?

A. dd

B. file

C. mkfile

D. touch

Answer: A

QUESTION NO: 22

When piping the output of find to the xargs command, what option to find is useful if the filenames have spaces in them?

A. -rep-space

B. -print0

C. -nospace

D. -ignore-space

Answer: B

QUESTION NO: 23

Which option to the tee command will cause the output to be concatenated on the end of the output file instead of overwriting the existing file contents?

A. -a

B. -c

C. --no-clobber

D. –continue

Answer: A

QUESTION NO: 24

Which of the following shell redirections will write standard output and standard error output to a file named filename?

A. 2>&1 >filename

B. >filename 2>&1

C. 1>&2>filename

D. >>filename

E. 1&2>filename

Answer: B

QUESTION NO: 25

What is the purpose of the & character at the end of a command line?

A. It causes standard error to be unbuffered.

B. It causes the command to be run in the background of the current shell.

C. It puts the command under the job control facilities of the current shell.

D. It causes the command to be run as a child of the initial login shell of the user.

Answer: B

QUESTION NO: 26

Which of the following commands will produce the following output?

USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND

root 1255 4.4 0.9 60716 34824 tty7 Ss+ 09:25 19:04 /usr/bin/X :0 -

root 2016 0.0 0.0 1792 560 tty1 Ss+ 09:26 0:00 /sbin/getty -8

matt 5204 0.0 0.1 6320 3696 pts/4 Ss 13:12 0:00 bash

matt 5219 0.0 0.0 3988 1624 pts/4 S+ 13:12 0:00 man bash

matt 5229 0.0 0.0 3584 932 pts/4 S+ 13:12 0:00 pager -s

matt 6768 0.0 0.1 10504 3880 pts/2 S+ 15:11 0:00 vi README.txt

A. jobs

B. proclist

C. netstat

D. ps

Answer: D

QUESTION NO: 27

In the vi editor, which of the following commands will copy the current line into the vi buffer?

A. c

B. cc

C. 1c

D. yy

E. 1y

Answer: D

QUESTION NO: 28

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: C

QUESTION NO: 29

Which signal is sent to a suspended process in order to have it resume execution?

A. CONT

B. EXEC

C. RESM

D. UNSP

Answer: A

QUESTION NO: 30

Which vi command will change modes so that text can be entered by typing in the keyboard?

A. e

B. i

C. t

D. w

Answer: B

QUESTION NO: 31

What is the purpose of the xargs command?

A. It passes argument to an X server.

B. It will read standard input and build up commands lines to execute.

C. It helps shell scripts take variable argument lists.

D. It will ask a question, graphically, and return the answer to the shell.

E. It will allow users to specify long options for commands that normally only accept short options.

Answer: B

QUESTION NO: 32

You've downloaded an image file of a boot floppy disk to your hard drive. What is the best utility to create a boot floppy from the disk image? (Specify a single command without options.)

Answer: dd, /bin/dd

QUESTION NO: 33

Which of the following commands will send output from the program myapp to both standard output (stdout) and the file file1.log?

A. cat < myapp | cat > file1.log

B. myapp 0>&1 | cat > file1.log

C. myapp | cat > file1.log

D. myapp | tee file1.log

E. tee myapp file1.log

Answer: D

QUESTION NO: 34

In the vi editor, what vi command will copy (but not paste) from the current line at the cursor and the following 16 lines (17 lines total)? Enter the correct vi command without spaces.

Answer: 17y, 17yy, 17YY, 17Y

QUESTION NO: 35

What command line redirection characters instruct the shell to read from the current input source until a specific word, on a separate line and without any trailing spaces, is reached?

A. <<

B. <|

C. !<

D. &<

Answer: A

QUESTION NO: 36

Which command will show you the contents of a gzip compressed tar archive?

A. gzip archive.tgz | tar xvf -

B. tar ztf archive.tgz

C. gzip -d archive.tgz | tar tvf -

D. tar cf archive.tgz

Answer: B

QUESTION NO: 37

Once a shell variable has been created, how can the variable be removed from the environment?

A. VAR=

B. set -d VAR

C. set -u VAR

D. unset VAR

Answer: D

QUESTION NO: 38

What is the purpose of the Bash built-in export command?

A. To allow disks to be mounted remotely.

B. To automate the export of variables for subsequently executed commands.

C. To make the command history available to sub-shells.

D. To run a command as a process in a sub-shell.

E. To save variable settings for future shell invocations.

Answer: B

QUESTION NO: 39

Which of the following is a limitation of the cut command?

A. The cut command can only select output by field position.

B. The cut command cannot reorder fields.

C. The cut command only works on ASCII text.

D. The cut command will always print one line of output for every line of input.

Answer: B

QUESTION NO: 40

Which of the following commands will print the first few lines of a text file to the shell?

A. cat -n 10 filename

B. dump -n 10 filename

C. head -n 10 filename

D. print -n 10 filename

Answer: C

QUESTION NO: 41

Which command will convert all tab characters in a file to spaces and print that to standard out?

A. convert

B. expand

C. retab

D. untab

Answer: B

QUESTION NO: 42

In order to use the output of ls to overwrite a file called bazz, which of the following command lines would you use?

A. ls > bazz

B. ls >& bazz

C. ls &> bazz

D. ls >> bazz

Answer: A

QUESTION NO: 43

In bash, inserting 2>&1 after a command redirects

A. standard error to standard input.

B. standard input to standard error.

C. standard output to standard error.

D. standard error to standard output.

E. standard output to standard input.

Answer: D

QUESTION NO: 44

Which signal is sent by the kill command by default?

A. HUP(1)

B. QUIT(3)

C. KILL(9)

D. TERM(15)

Answer: D

QUESTION NO: 45

What command will display all of the background tasks running in the current shell?

A. history

B. jobs

C. kill -l

D. list

Answer: B

QUESTION NO: 46

To ensure that a running process continues to execute after you log out, the process should be started with what command?

A. live

B. nohup

C. saferun

D. sh

Answer: B

Site Search:

Close

Close
Download Free Demo of VCE
Exam Simulator

Experience Avanset VCE Exam Simulator for yourself.


Simply submit your e-mail address below to get started with our interactive software demo of your free trial.


Enter Your Email Address

Free Demo Limits: In the demo version you will be able to access only first 5 questions from exam.