Nothing Special   »   [go: up one dir, main page]

117-101 Real Exam Questions - Guaranteed: Number: 117-101 Passing Score: 700 Time Limit: 120 Min File Version: 27.4

Download as pdf or txt
Download as pdf or txt
You are on page 1of 32

117-101 Real Exam Questions - Guaranteed

Number: 117-101
Passing Score: 700
Time Limit: 120 min
File Version: 27.4

http://www.gratisexam.com/

117-101 Real Exam Questions - Guaranteed

Exam Name: Lpi Level 1 Exam 101(with rpm)

For Full Set of Questions please visit: http://www.braindumps.com/117-101.htm

Sections
1. Part 1
2. Part 2
3. Part 3
4. Part 4
5. Part 5
6. Part 6
7. Part 7
8. Part 8
9. Part 9
10. Part 10
11. Part 11
Exam A

QUESTION 1
In Bash, inserting "1>&2" 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

Correct Answer: C
Section: Part 3
Explanation

Explanation/Reference:
A) 2>&1
B) does not make sense
D) 2>&1
E) use | (pipe) to redirect stdout to stdin

QUESTION 2
Identify the proper device for the third partition, on the second hard disk, on the first IDE controller on a PC
system.

A. /dev/hdb3
B. /dev/hd1b3
C. /dev/hdc1b3
D. /dev/hdc1d2p3

Correct Answer: A
Section: Part 3
Explanation

Explanation/Reference:
For IDE drives:
primary master /dev/hda
primary slave /dev/hdb
secondary master /dev/hdc
secondary slave /dev/hdd
So the 3rd partition on the second harddrive is /dev/hdb3 (or /dev/sdb3 for SCSI drives)

QUESTION 3
Which command will create an ext3 filesystem on /dev/hda2?

A. /sbin/mke2fs -d /dev/hda2
B. /sbin/mke2fs -j /dev/hda2
C. /sbin/mke2fs -m 3 /dev/hda2
D. /sbin/mke2fs -c ext3 /dev/hda2

Correct Answer: B
Section: Part 3
Explanation

Explanation/Reference:
mke2fs - create an ext2/3/4 filesystem
-j Create the filesystem with an ext3 journal.

If the -j option is not specified, the default journal parameters will be used to create an appropriately sized
journal (given the size of the filesystem) stored within the filesystem. Note that you must be using a kernel,
which has ext3 support in order to actually make use of the journal.

QUESTION 4
What is the proper option to put in /etc/fstab to enable group quotas for a particular parition?

A. groupquota
B. grpquota
C. groupquotas
D. grpquotas

Correct Answer: B
Section: Part 3
Explanation

Explanation/Reference:
Use grpquota for groups or usrquota for users in /etc/fstab

QUESTION 5
Which utility would you use to change how often a filesystem check was performed over an EXT2 filesystem
(without losing any data stored on that filesystem)?

A. mod2fs
B. fsck
C. tune2fs
D. mke2fs
E. fixe2fs

Correct Answer: C
Section: Part 3
Explanation

Explanation/Reference:
tune2fs is used to change parameters in the superblock
fsck is used to check the (unmounted) filesystem
mke2fs is used to format the partition

QUESTION 6
What TWO permissions must a user have in order to run a shell script?

A. read
B. write
C. execute
D. browse on the directory
E. users cannot run shell scripts

Correct Answer: AC
Section: Part 4
Explanation

Explanation/Reference:
You do not need write privileges on shell scripts.
Directory browsing priviliges are not needed if you know exactly how to start the script, even without this
permission you may change into the directory and start the shell script
Users can run any application as long as the specific permission is set (read and execute right for owner, group
or others)

QUESTION 7
You are using quota on your system. How can you see disk quota details?

http://www.gratisexam.com/

A. repquota
B. quota -l
C. quota
D. quotachech
E. quota --list

Correct Answer: A
Section: Part 4
Explanation

Explanation/Reference:
quota lists the quotas for a user or group, use repquota for a drive or partition

QUESTION 8
You are experimenting with a binary in /tmp/foo.d that expects its configuration file at /etc/foo.conf.
You don't want to save it there, but use a symbolic link to /tmp/foo.d/foo.conf instead.

Which command would accomplish that?

A. ln -s /tmp/foo.d/foo.conf /etc/foo.conf
B. ln /tmp/foo.d/foo.conf /etc/foo.conf
C. ln -s /etc/foo.conf /tmp/foo.d/foo.conf
D. ln /etc/foo.conf /tmp/foo.d/foo.conf

Correct Answer: A
Section: Part 4
Explanation

Explanation/Reference:
To create a symbolic link (symlink) you need to specify the -s option for the command ln.
The correct syntax for ln is
ln -s <original> <symlink>

QUESTION 9
Which of the following Linux filesysterns pre-allocates a fixed number of inodes at filesysterns make/creation
time, and does NOT generate them as needed?

A. ext3
B. jfs
C. reiserfs
D. xfs

Correct Answer: A
Section: Part 4
Explanation

Explanation/Reference:
reiserfs does not even use inodes
jfs and xfs use dynamic inode allocation

QUESTION 10
You have just added a CD-ROM drive (/dev/hdd) to your system and have added it to your fstab.

Typically you can use which of the following commands to mount media in that drive to /mnt/cdrom?

A. mount /dev/cdrom /mnt/cdrom


B. mount /dev/cdrom
C. mount -t cdrom/dev/cdrom /mnt/cdrom
D. mount /mnt/cdrom
E. automount /mnt/hdd /mnt/cdrom

Correct Answer: D
Section: Part 4
Explanation

Explanation/Reference:
mount can work with either devicename or mountpoint if the device was added in /etc/fstab (and the mountpoint
exists)
(and /dev/cdrom is not the correct devicename)

QUESTION 11
What would the following line accomplish if run as root?

chown -R bert /home/bert/*

A. Nothing, this command is invalid.


B. It would revoke bert's ownership of all files in /home/bert to bert.
C. It would change user ownership of all files in /home/bert to bert.
D. It would set the group ownership of the directory /home/bert to bert
E. It would set ownership of all files and subdirectories in /home/bert to bert

Correct Answer: E
Section: Part 4
Explanation

Explanation/Reference:
From the man pages:
chown changes the user and/or group ownership of each given file. -R operate on files and directories
recursively

QUESTION 12
Which one of the following programs will only find files that are in your PATH?

A. locate
B. slocate
C. which
D. find

Correct Answer: C
Section: Part 4
Explanation

Explanation/Reference:
From the man pages:
which returns the pathnames of the files (or links) which would be executed in the current environment, had
its arguments been given as commands in a strictly POSIX-conformant shell. It does this by searching the
PATH for executable files matching the names of the arguments. It does not follow symbolic links.

QUESTION 13
Which chown command will change the ownership to foo and the group to bar on a file named biglist?

A. chown foo/bar biglist


B. chown -u foo -g bar biglist
C. chown foo:bar biglist
D. chown --user foo --group bar biglist

Correct Answer: C
Section: Part 4
Explanation

Explanation/Reference:
From the manual pages:
SYNOPSIS
chown [OPTION]... [OWNER][:[GROUP]] FILE...

There is no parameter for user and/or group, and the correct seperation character is the ":"

QUESTION 14
You would like to find files with spaces in their names. What is the correct option of command find you have to
use?

A. -print
B. -ignore-space
C. -nospace
D. -print0

Correct Answer: D
Section: Part 4
Explanation

Explanation/Reference:

QUESTION 15
You have two shell scripts, foo and bar.

You wish to have bar execute if foo returns an exit status of 0 Select the correct command:

A. foo; bar
B. foo || bar
C. foo && bar
D. foo % bar

Correct Answer: C
Section: Part 5
Explanation

Explanation/Reference:
A) executes foo and bar regardless of exit codes
B) executes bar only if foo fails
D) % is used in trimming text in the shell

QUESTION 16
Which command shows the space which is used by files and directories?

A. du
B. df
C. find
D. ls

Correct Answer: A
Section: Part 5
Explanation

Explanation/Reference:

QUESTION 17
You are editing a file with vi and you realize that the file has been changed. With what command can you force
vi to reload the file without leaving?

A. :w
B. :e
C. ZZ
D. :r

Correct Answer: D
Section: Part 5
Explanation

Explanation/Reference:

QUESTION 18
You need to create a simple hierarchy of directories: images/photos/summer/ottawa/

None of the directories on that path exists. What command will create all of the needed directories in one step?

A. mkdir -r images/photos/summer/ottawa/
B. mkdir -R images/photos/summer/ottawa/
C. mkdir -p images/photos/summer/ottawa/
D. mkdir -P images/photos/summer/ottawa/
E. mkdir -m images/photos/summer/ottawa/

Correct Answer: C
Section: Part 5
Explanation

Explanation/Reference:
From the man pages:
mkdir - make directories
-p, --parents make parent directories as needed

QUESTION 19
You enter the command date +%M. Wat does the output show you?

A. the current year


B. the current month
C. the current hour
D. the current minute
E. the current second

Correct Answer: D
Section: Part 5
Explanation

Explanation/Reference:
From the man pages:
date - print or set the system date and time
date [OPTION]... [+FORMAT]
date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]
[...]
%A locale's full weekday name, variable length (Sunday..Saturday)
%b locale's abbreviated month name (Jan..Dec)
%B locale's full month name, variable length (January..December)
%c locale's date and time (Sat Nov 04 12:02:33 EST 1989)
%C century (year divided by 100 and truncated to an integer) [00-99]
%d day of month (01..31)
%H hour (00..23)
%m month (01..12)
%M minute (00..59)
%Y year (1970...)

QUESTION 20
Which of the following commands will list the quota for the user foobar?

A. repquota foobar
B. quota foobar
C. lsquota foobar
D. printquota foobar

Correct Answer: B
Section: Part 5
Explanation

Explanation/Reference:
From the man pages:
quota displays users' disk usage and limits. By default only the user quotas are printed.
repquota prints a summary of the disk usage and quotas for the specified file systems.

lsquota and printquota commands do not exist.

QUESTION 21
You have an USB storage device that you cannot get working. You have enabled all appropriate USB options in
the latest 2.2 kernel but still cannot get your device working.

What is most likely the source of the problem?

A. You have not configured your usb.usermap properly


B. You are using the wrong kernel for this type of device
C. The USB device is not USB 2.0 compliant
D. There is a USB resource conflict

Correct Answer: B
Section: Part 5
Explanation

Explanation/Reference:
Only USB1.0 is supported for Kernel 2.2, upgrade to at least 2.4 to use USB2.0

QUESTION 22
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

Correct Answer: E
Section: Part 6
Explanation

Explanation/Reference:
Option -r, --remove removes everything except configuration files.
Use option -R, --purge to remove packages completely.

-L lists all files for an installed package


-s displays the status of a package

QUESTION 23
You have not run apt-get on a system for some time, but it has been run on the system before.

What apt-get command would you run to download the latest list of packages, but not the packages
themselves?

A. apt-get build-dep
B. apt-get mirror-select
C. apt-get update
D. apt-get upgrade
E. apt-get dist-upgrade

Correct Answer: C
Section: Part 6
Explanation

Explanation/Reference:
Unlike rpm, use option update to load new package lists and upgrade to load new versions of installed
packages.
QUESTION 24
What is the purpose of the bash built-in export command?

A. To allow disks to be mounted remotely.


B. To run a command as a process in a sub-shell.
C. To make the command history available to sub-shells.
D. To setup environment variables for applications.
E. To share NFS partitions for use by other systems on the network.

Correct Answer: D
Section: Part 9
Explanation

Explanation/Reference:
Without export, a variable will only be visible in the process that defined it. Exported variables are also visible in
all child processes that are created after the export.

QUESTION 25
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

Correct Answer: B
Section: Part 10
Explanation

Explanation/Reference:
A) gzip <filename> would inplace compress <filename>; using pipe would not make sense
C) gzip -d <filename> would inplace uncompress <filename>.gz; pipe also would not make sense here
D) tar cf <filename> would create an archive, not list the contents.

QUESTION 26
What can the tee command be used for?

A. Print the contents of a file in reverse order


B. Use the output of one command as arguments to another
C. Add line numbers to the output of a command
D. Pipe the output of one command into the input of another
E. Send a command's output to stdout and to a file at the same time

Correct Answer: E
Section: Part 10
Explanation

Explanation/Reference:
From the man pages:
tee - read from standard input and write to standard output and files

QUESTION 27
Which of the following commands will replace every instance of the word list with LIST from the file myfile.txt
and print the results on the screen?
A. sed --in-place -e "s/list/LIST/" myfile.txt
B. sed -e "s/list/LIST/" myfile.txt
C. sed --in-place -e "/list/LIST/" myfile.txt
D. sed -e "/list/LIST/" myfile.txt

Correct Answer: B
Section: Part 10
Explanation

Explanation/Reference:
Technically even B) is not the correct answer, but it is the least wrong answer.
sed -e "s/list/LIST/g" myfile.txt would replace EVERY occurrance of list in myfile.txt

The other 3 answers either modify the source file, or are just plain wrong.

QUESTION 28
Which TWO runlevels should never be declared as the default runlevel?

A. 0
B. 3
C. 5
D. 6

Correct Answer: AD
Section: (none)
Explanation

Explanation/Reference:
From the man pages:
Runlevels 0, 1 and 6 are reserved. Runlevel 0 is used to halt the system and 6 to reboot the system. Runlevel 1
is used to bring the system back down into single-user mode.

QUESTION 29
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

Correct Answer: A
Section: Part 9
Explanation

Explanation/Reference:
telinit 1 orders the init process to switch to runlevel 1, stopping all services not configured for runlevel 1,
including network and multiuser support.
Exam B

QUESTION 1
You need to install a fax server. Which type of fax/modem should you install to ensure Linux compatibility?

A. External Serial Fax/modem


B. External USB Fax/modem
C. Internal ISA Fax/modem
D. Internal PCI Fax/modem

Correct Answer: A
Section: Part 1
Explanation

Explanation/Reference:
Older kernels do not support USB, and internal modems need drivers which might not always be available. But
a serial driver is active in all linux kernels, making a serial modem the most compatible.

QUESTION 2
What command would help you identify the I/O address range being used by the network card?

A. cat /proc/modules
B. cat /proc/devices
C. cat /proc/meminfo
D. cat /proc/dma
E. cat /proc/ioports

Correct Answer: E
Section: Part 1
Explanation

Explanation/Reference:
For example:
# cat /proc/ioports
[...]
9000-9fff : PCI Bus 0000:04
9c00-9c3f : 0000:04:09.0
9c00-9c3f : e1000
[...]

/proc/modules contains the loaded kernel modules, /proc/devices the available devices, /proc/meminfo
information about memory usage,
/proc/dma contains the used dma channels.

QUESTION 3
What tool can you use to print shared library dependencies?

A. ldconfig
B. ldd
C. libdep
D. libpath
E. ldev

Correct Answer: B
Section: Part 1
Explanation
Explanation/Reference:
ldd command prints the shared libraries required by each program or shared library specified on the command
line.

Example:

ldd `which cat`


linux-vdso.so.1 => (0x00007fff2b3ff000)
libc.so.6 => /lib64/libc.so.6 (0x000000395ce00000)
/lib64/ld-linux-x86-64.so.2 (0x000000395ca00000)

QUESTION 4
You have an updated RPM called screensaver-1.1.i386.rpm. You have version 1.0 installed.
Using RPM, how do you view the changelog of this file to see if you should install the update?

A. rpm -qp --changelog screensaver-1.1.i386.rpm


B. rpm --changelog screensaver-1.1.i386.rpm
C. rpm -qc screensaver-1.1.i386.rpm
D. rpm -showchangelog screensaver-1.1.i386.rpm

Correct Answer: A
Section: Part 1
Explanation

Explanation/Reference:
When you use rpm with a specific rpm-file, you need to specify the -p option, and the query-option to show the
changelog is --changelog.
-qc would list the config files of an installed package (not an rpm-file)
--changelog on its own is an invalid option as is -showchangelog

QUESTION 5
You are about to install a new program on an RPM based Linux system.
Which of the following would be the best way to accomplish this?

A. Get the source code in a tarball and install from that source.
B. Get a source RPM and use rpm to install it.
C. Use rpm to install the program's binaries from an RPM package.
D. Use cpio to extract the binaries from a source RPM and use rpm to install those sources.

Correct Answer: C
Section: Part 1
Explanation

Explanation/Reference:
If a rpm-file is available the easiest way is to use "rpm" to install it, since the binaries are already available. If
source-files are used a development environment (make, gcc, ...) must also be available.

QUESTION 6
You achieve the command umount /mnt and get the following message:

umount /mnt : device is busy

What is the most likely reason for this message?

A. The kernel has not written the buffer to harddisk.


B. A user is accessing a file on this filesystem.
C. The harddisk has to be waken up.
D. You are not allowed to unmount a mountpoint.

Correct Answer: B
Section: Part 1
Explanation

Explanation/Reference:

QUESTION 7
Where does lilo store its boot information?

A. Boot ROM
B. Boot RAM
C. Master Boot Record
D. /boot partition

Correct Answer: C
Section: Part 1
Explanation

Explanation/Reference:
lilo uses /etc/lilo.conf to store its configuration and uses the 66 bytes of free space in the MBR to install itself
there (or optionally in the / folder).
GRUB uses the /boot folder to store itself and the "compiled" configuration.

QUESTION 8
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

Correct Answer: C
Section: Part 1
Explanation

Explanation/Reference:
ld.so looks in LD_LIBRARY_PATH before looking anywhere else for libraries.

QUESTION 9
Which of the following is very important when installing from source code?

(Check TWO that apply)

A. Read all documentation included with the source code.


B. Reboot after installing all programs.
C. Manually check to see if all dependencies are met.
D. Use rpm or dpkg go verify the installation.
E. Do not install binaries as the root user.
Correct Answer: AC
Section: Part 2
Explanation

Explanation/Reference:
Normally you do not need to reboot when installing software, and you need to install binaries as root (until just
installing software for one user only). When installing from source code you can not use rpm to verify the install.

QUESTION 10
You installed a beta rpm package, but are experiencing some problems with it.

How can you remove this package?

A. rpm -qe rpmname


B. rpm -V --remove rpmname
C. rpm -r rpmname
D. rpm -d rpmname
E. rpm -ev rpmname

Correct Answer: E
Section: Part 2
Explanation

Explanation/Reference:
To uninstall the package, use
rpm -e, --erase <packagename>
(-v for verbose)

-r puts rpm in superuser mode (requires password)


-V verifys packages
-qe checks if the package is installed
-d is working in combination with -q only

QUESTION 11
You see following output while trying to install an updated package:

[root@example pub]# rpm -i gthumb-2.2.0.i386.rpm


package gthumb- 1.0.1.i386.rpm is already installed.

Which command will allow you to install the updated version?

A. rpm -i gthumb-2.2.0.i386.rpm
B. rpm -ivh gthumb-2.2.0.i386.rpm
C. rpm -U gthumb-2.2.0.i3S6.rpm
D. rpm -qu gthumb-2.2.0.i386.rpm
E. rpm -qiv gthumb-2.2.0.i386.rpm

Correct Answer: C
Section: Part 2
Explanation

Explanation/Reference:
-qu, -qiv would indicate rpm-queries,
-i was already not working
-h is just activating a progress bar
use -U or --upgrade to update a package
QUESTION 12
What key sequence will suspend the current process and return you to a shell prompt?

A. Ctrl-z
B. Ctrl-c
C. Ctrl-x
D. Ctrl-d

Correct Answer: A
Section: Part 2
Explanation

Explanation/Reference:
CTRL+Z sends SIGINT to the current process, sending it to the background,
CTRL+C would send SIGTERM, ending the process
CTRL+D is used to signal an EOF
CTRL+X has no meaning in a shell

QUESTION 13
What command changes the priority of the process running with process id of 12345 to the highest priority?

A. /usr/bin/renice +20 12345


B. /usr/bin/renice -20 12345
C. /bin/setpriority +20 12345
D. /bin/setpriority -20 12345

Correct Answer: B
Section: Part 2
Explanation

Explanation/Reference:
To change the priority of running process use the renice command. Default priority is 0, highest priority is -20
and lowest priority is 19. The path of renice command is /usr/bin/renice.

QUESTION 14
Which of the following GNU commands would be the most likely command you'd use to find the system load
average?

A. top
B. nice
C. loadavg
D. cpustat
E. ps

Correct Answer: A
Section: Part 3
Explanation

Explanation/Reference:
The top program provides a dynamic real-time view of a running system. It can display system summary
information as well as a list of tasks currently being managed by the Linux kernel. The types of system
summary information shown and the types, order and size of information displayed for tasks are all user
configurable and that configuration can be made persistent across restarts.

ps is used to display the running processes of the user, nice is used to set the priority of a command.
cpustat and loadavg does not exist in debian or fedora.

QUESTION 15
Which of the following commands is equivalent to kill 1234?

A. kill -1 1234 or kill -s SIGHUP 1234


B. kill -2 1234 or kill -s SIGINT 1234
C. kill -3 1234 or kill -s SIGQUIT 1234
D. kill -9 1234 or kill -s SIGKILL 1234
E. kill -15 1234 or kill -s SIGTERM 1234

Correct Answer: E
Section: Part 3
Explanation

Explanation/Reference:
If no signal is specified kill uses SIGTERM (15) as its default signal to processes.

QUESTION 16
What command will remove duplicate lines from a sorted file?

A. filter
B. trim
C. uniq
D. wc

Correct Answer: C
Section: Part 3
Explanation

Explanation/Reference:
uniq - remove duplicate lines from a sorted file

wc - wordcount
trim - remove whitespaces
filter is not standard unix filter command

QUESTION 17
You want to search the file myfile for all occurances of string containing at least five characters,
where character number 2 and 5 are 'a' and character number 3 is NOT 'b'.

Which command would you use?

A. grep a*^b*a myfile


B. grep .a[^b].a myfile
C. grep .[a].*.[a] myfile
D. grep .a*^b..a myfile

Correct Answer: B
Section: Part 3
Explanation

Explanation/Reference:
A) since ^ without brackets indicates beginning of line, this regex would search for lines where any count of 'a'
come before the start of the line
C) would find every combination like xabax
D) has the same problem as A

QUESTION 18
What does the following command do?

cat '$TEST'

A. Displays a bash syntax error message.


B. Displays the contents of the file named $TEST if it exists.
C. Waits for the user to enter text and then echos the text back.
D. Displays the contents of the file named inside the back quotes.
E. Displays the contents of the named by the environment variable TEST.

Correct Answer: B
Section: Part 3
Explanation

Explanation/Reference:
single quotation marks instruct the bash not to do wildcard expansion or variable replacement, so cat will
display the file called exactly $TEST
use double quotation marks to get variable replacement, but not wildcard replacement, and no quotations to get
both.
Do not confuse with `cmd` which evaluates the command and replaces its output on the shell.

QUESTION 19
Which of these commands allows you to use shared libraries that are in /usr/local/lib?

A. export LD_PRELOAD=/usr/local/lib
B. export LD_LIBRARY_PATH=/usr/local/lib
C. ldconfig /usr/local/lib
D. ldd /usr/local/lib

Correct Answer: B
Section: Part 9
Explanation

Explanation/Reference:
ld.so searches for shared libraries in LD_LIBRARY_PATH before looking in the standard directories.
alternatively you can specify the directory in the /etc/ld.so.conf and running ldconfig.

QUESTION 20
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

Correct Answer: D
Section: Part 9
Explanation

Explanation/Reference:
to work with specific rpm-files you need the parameter -p, -ql lists all files for a package.
alternatively you could specify the --test parameter when installing

QUESTION 21
User Joseph has successfully extracted and compiled a program from source code. Installing the binaries
produces errors.

What is the most likely reason?

A. The source code was compiled for a different CPU


B. The permissions set in the /usr/bin directory are wrong
C. The binaries require root privileges to be installed
D. The wrong prefix was used during configuration of the source code

Correct Answer: C
Section: Part 9
Explanation

Explanation/Reference:
Normally only the root user has write-privileges on /usr/bin, install binaries only as root.

QUESTION 22
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

Correct Answer: C
Section: Part 9
Explanation

Explanation/Reference:
In Linux, this keystroke combination is recognized by the keyboard device driver in the kernel. In the absence of
more specific instructions, which will usually only be during system initialization, the kernel directly initiates a
soft reboot in response. More commonly, the kernel will send a signal to the init process, which will perform an
administrator-configured task, such as running a script, or displaying an "end current session" box in KDE.
However, Linux systems can be configured to ignore the keystroke combination. The setting is usually in the
inittab(5) configuration file under the keyword "ca".

In newer Linux systems (using upstart) /etc/inittab is replaced by /etc/event.d/

QUESTION 23
What is the PID for the Init that is the parent of all the process?

A. 0
B. 1
C. changes on reboot
D. same as current runlevel
E. -1

Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
init is the first process the kernel starts, so init always has root priviliges and PID 1

QUESTION 24
From any mode in vi, how do you save a the current file and exit vi?

(give 2 options)

A. ESC :wq!
B. ESC :q!
C. ESC ZZ
D. ESC :Q

Correct Answer: AC
Section: (none)
Explanation

Explanation/Reference:
there is no ":" before ZZ!
Exam C

QUESTION 1
What single command (no options or arguments) can be used to fully extract a file called abc.tar.bz2?

A. gzip
B. gunzip
C. tar
D. bz2unzip

Correct Answer: C
Section: Part 6
Explanation

Explanation/Reference:
gzip and gunzip work with *.gz files, and there is no bz2unzip command, leaving only tar as he right answer.

QUESTION 2
A Makefile typically contains which targets?

A. CFLAGS, CPPFLAGS, LIBS, LDFLAGS


B. clean, install, uninstall
C. PATHS, DESTDIR, LIBS, LDFLAGS
D. prefix, exec_prefix, bindir, mandir

Correct Answer: B
Section: Part 6
Explanation

Explanation/Reference:
While makefiles can contain every one of the above targets, commonly clean, install, and uninstall are used in
makefiles.

QUESTION 3
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

Correct Answer: D
Section: Part 6
Explanation

Explanation/Reference:

QUESTION 4
All items are required to enable USB support on a Linux system EXCEPT...

A. A kernel that has USB driver support


B. A USB 2.0 compatible device
C. A supported controller chip such as OHCI, UHCI, or EHCI
D. A kernel that supports hot-pluggable devices

Correct Answer: B
Section: Part 7
Explanation

Explanation/Reference:
You need a Kernel with USB and hot-pluggable device support (2.2 or later), you need a supported USB
controller. A USB2.0 device is not a requirement (since USB1.0 is also supported)

QUESTION 5
According to the File System Hierarchy Standard, the lost+found directory is used for:

A. files with unknown owners


B. missing device files found by/proc
C. unknown binary files found by find
D. unlinked files found by fsck

Correct Answer: D
Section: Part 7
Explanation

Explanation/Reference:
See http://tldp.org/LDP/Linux-Filesystem-Hierarchy/html/lostfound.html

QUESTION 6
The sticky bit is usually set on

A. /var/log
B. /tmp
C. /home
D. log files

Correct Answer: B
Section: Part 7
Explanation

Explanation/Reference:
When the sticky bit is set, only the item's owner, the directory's owner, or the superuser can rename or delete
files. This prevents users from deleting other users files. That is especially important in /tmp because everyone
may write in /tmp.

QUESTION 7
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 leading and trailing characters, is reached?

A. <<
B. <l
C. !<
D. $<

Correct Answer: A
Section: Part 7
Explanation
Explanation/Reference:
Example:
$ echo <<foobar
Hello
foobar
Hello

QUESTION 8
Which of the following commands will display the last 30 lines of /var/log/bigd.log as well as new content as it is
appended to the file by another process?

A. cut -30 -v /var/log/bigd.log


B. head -30 -e /var/log/bigd.log
C. tail -f -n 30 /var/log/bigd.log
D. tac -30 /var/log/bigd.log
E. cat -r -n 30 /var/log/bigd.log

Correct Answer: C
Section: Part 7
Explanation

Explanation/Reference:
From the man pages:
tail - output the last part of files

QUESTION 9
Which of the following commands will find the string foo in file1.txt, regardless of foo being in upper or
lowercase letters?

A. cat file1.txt | grep -i foo


B. cat file1.txt > grep -n foo
C. grep -i foo | file1.txt
D. grep -n file1.txt < foo
E. grep -n foo file1.txt

Correct Answer: A
Section: Part 7
Explanation

Explanation/Reference:
grep option -i tells grep to work case insensitive.

QUESTION 10
The command used to determine a file's type is ...

A. type
B. find
C. file
D. ls

Correct Answer: C
Section: Part 8
Explanation

Explanation/Reference:
From the man pages:
file — determine file type

QUESTION 11
Keyboards and mice are members of which class of USB devices?

A. Communication Device Class


B. Human Interface Device Class
C. Mass Storage Device Class
D. Data Interface Device Class

Correct Answer: B
Section: Part 8
Explanation

Explanation/Reference:
Kernel 2.2 only supported HID-class USB1.0 devices.

QUESTION 12
Given the following output:

# myapp
[1]+ Stopped myapp
#

Which of the following commands will resume executing the stopped process while allowing the user to
continue to type commands at the command prompt?

A. bg myapp
B. continue myapp
C. exec myapp
D. fg myapp
E. myapp &

Correct Answer: A
Section: Part 8
Explanation

Explanation/Reference:
bg [jobspec] Place jobspec into the background, as if it had been started with `&'. If jobspec is not supplied,
the current job is used.
fg [jobspec] Bring jobspec into the foreground and make it the current job. If jobspec is not supplied, the
current job is used.
Use jobs to list all current background processes

QUESTION 13
Which shell built-in command can be used to create a shortcut or pseudonym for a longer command? Assume
a modern bourne-like shell, such as bash.

A. shortcut
B. ln
C. sudo
D. link
E. alias

Correct Answer: E
Section: Part 8
Explanation

Explanation/Reference:
In bash you can use alias to create shell internal commands.

Example:
$ alias
alias grep='grep --color=auto'
alias ll='ls -alF'
alias ls='ls --color=auto'

ln creates symlinks or hardlinks (can be used to create aliases, but does not work with options)
sudo starts a command with root privileges

QUESTION 14
Which of the following commands will send output from the program myapp to both stdout and the file file1.txt?

A. cat < myapp | cat > file1.txt


B. myapp 0>&1 | cat > file1.txt
C. myapp | cat > file1.txt
D. myapp | tee file1.txt
E. tee myapp file1.txt

Correct Answer: D
Section: Part 8
Explanation

Explanation/Reference:
From the man pages:
tee - read from standard input and write to standard output and files

QUESTION 15
Select the line that best represents what permissions the /etc/passwd file should have

A. -rw------- 1 root root 531 Apr 3 12:36 /etc/passwd


B. -rw-r--r-- 1 root root 531 Apr 3 12:36 /etc/passwd
C. -rw-r--r-- 1 1 1 531 Apr 3 12:36 /etc/passwd
D. all answers listed are not correct
E. all answers listed are correct

Correct Answer: B
Section: Part 8
Explanation

Explanation/Reference:
All Users should be able to read /etc/passwd to gain certain important information about users and groups.
C) indicates that someone deleted the root user from the system

QUESTION 16
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

Correct Answer: E
Section: Part 10
Explanation

Explanation/Reference:

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

A. -10
B. 10
C. 20
D. 0

Correct Answer: B
Section: Part 10
Explanation

Explanation/Reference:
From the man pages:
nice - run a program with modified scheduling priority
-n, --adjustment=N add integer N to the niceness (default 10)

QUESTION 18
While editing a file in vi, you realize that you are changing the wrong file.

What vi command sequence will allow you to quit without saving your changes?

A. :Q!
B. :q!
C. :w!
D. :wq!

Correct Answer: B
Section: Part 10
Explanation

Explanation/Reference:

QUESTION 19
Which command will allow an administrator to adjust the number of mounts after which an existing filesystem
will be checked by e2fsck?

A. debugfs
B. dumpe2fs
C. mode2fs
D. tune2fs
E. mke2fs
Correct Answer: D
Section: Part 10
Explanation

Explanation/Reference:
From the man pages:
tune2fs - adjust tunable filesystem parameters on ext2/ext3/ext4 filesystems

QUESTION 20
You want to upgrade all installed packages with apt-get. What is the correct option?

(Option only)

A. -update
B. -upgrade
C. upgrade
D. update

Correct Answer: C
Section: (none)
Explanation

Explanation/Reference:
Exam D

QUESTION 1
Which program finds only files that are in your PATH?

Correct Answer: which


Section: Part 9
Explanation

Explanation/Reference:
From the man pages:
which returns the pathnames of the files (or links) which would be executed in the current environment, had
its arguments been given as commands in a strictly POSIX-conformant shell. It does this by searching the
PATH for executable files matching the names of the arguments. It does not follow symbolic links.

QUESTION 2
Upon booting one of your Linux boxes, you notice a message scrolling by that does not look right, but it goes so
fast, you do not have a chance to read it.

What command could you use to view that message after the boot process completes?

Correct Answer: dmesg


Section: Part 9
Explanation

Explanation/Reference:
From the man pages:
dmesg - print or control the kernel ring buffer

QUESTION 3
Which option must be listed in /etc/fstab to activate user quotas automatically?

Correct Answer: usrquota


Section: Part 9
Explanation

Explanation/Reference:
mount uses usrquota and grpquota as mount parameters (column 4 in fstab) to enable quotas for a partition.

QUESTION 4
Which user-level program, when manually executed by the root user, is used to change the runlevel of the
system? (Provide only the command with no additional options or parameters)

Correct Answer: init


Section: Part 10
Explanation

Explanation/Reference:
when using init as a command, init itself just runs telinit to send the new runlevel to the init process (with the
PID 1)

QUESTION 5
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.

Correct Answer: 17yy


Section: Part 10
Explanation

Explanation/Reference:

QUESTION 6
The/etc/ ________ file lists currently mounted devices.

Correct Answer: mtab


Section: Part 10
Explanation

Explanation/Reference:

QUESTION 7
________ /dev/sda3 will create a swap area on the device/dev/sda3.

Correct Answer: mkswap


Section: Part 11
Explanation

Explanation/Reference:

http://www.gratisexam.com/

QUESTION 8
Which command will convert an RPM package file to a cpio archive?

(Provide only the command with no options or parameters)

Correct Answer: rpm2cpio


Section: Part 11
Explanation

Explanation/Reference:

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

Correct Answer: reconfigure


Section: Part 11
Explanation

Explanation/Reference:

QUESTION 10
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)

Correct Answer: ldd /usr/lib/libpng12.so


Section: Part 11
Explanation

Explanation/Reference:

QUESTION 11
USB fax/modems that conform to this subclass of the Communication Device Class (CDC) vendor neutral
standard are Linux compatible (answer is a 3 letter acronym)

Correct Answer: ACM -or- acm


Section: Part 6
Explanation

Explanation/Reference:

QUESTION 12
You have written a custom tool on your local system. Following the File Hierarchy Standard (FHS), where
should you install the binaries to be available to all users on your system?

Correct Answer: /usr/local/bin


Section: Part 4
Explanation

Explanation/Reference:

QUESTION 13
You are compiling some software from source. After running ./configure with the appropriate arguments and no
errors, what is the next command to run?

Correct Answer: make


Section: Part 5
Explanation

Explanation/Reference:

QUESTION 14
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 drives?

Correct Answer: interrupts


Section: Part 1
Explanation

Explanation/Reference:
The Linux /proc Directory is a Virtual Filesystem provided by linux kernel. /proc contains files and directories
that let system administrators and programmers access system information. The file /proc/interrupts file
contains information on interrupts and IRQs.

Example:
$ cat /proc/interrupts
CPU0 CPU1
0: 25 14 IO-APIC-edge timer
1: 4710 1831 IO-APIC-edge i8042
4: 0 2 IO-APIC-edge
6: 0 5 IO-APIC-edge floppy
7: 1 0 IO-APIC-edge parport0
8: 0 1 IO-APIC-edge rtc0
9: 0 0 IO-APIC-fasteoi acpi
12: 2493 219349 IO-APIC-edge i8042
14: 0 0 IO-APIC-edge pata_amd
15: 133 25008 IO-APIC-edge pata_amd
16: 136945 7434 IO-APIC-fasteoi nvidia
17: 0 1172 IO-APIC-fasteoi eth0_rename
20: 0 0 IO-APIC-fasteoi ohci_hcd:usb2
21: 701 2368 IO-APIC-fasteoi ehci_hcd:usb1
22: 4 412 IO-APIC-fasteoi sata_nv, HDA Intel
23: 90839 14138 IO-APIC-fasteoi sata_nv, eth4
NMI: 0 0 Non-maskable interrupts
LOC: 236626 98439 Local timer interrupts
SPU: 0 0 Spurious interrupts
PMI: 0 0 Performance monitoring interrupts
PND: 0 0 Performance pending work
RES: 1205807 1212171 Rescheduling interrupts
CAL: 1078 1174 Function call interrupts
TLB: 87901 91058 TLB shootdowns
TRM: 0 0 Thermal event interrupts
THR: 0 0 Threshold APIC interrupts
MCE: 0 0 Machine check exceptions
MCP: 8 8 Machine check polls
ERR: 1
MIS: 0

QUESTION 15
You wish to execute two commands, one after the other. However, you only want the second command to
execute if the first is successful.

Which character(s) do you put between the commands on the command line to accomplish this?

Correct Answer: &&


Section: Part 2
Explanation

Explanation/Reference:
&& logical and (execute cmd2 ONLY if cmd1 was successful)
|| logical or (execute cmd2 only if cmd1 was NOT successful)

QUESTION 16
You want a process to keep running after you have logged out. What command to use ?

Correct Answer: nohup


Section: (none)
Explanation

Explanation/Reference:
nohup - run a command immune to hangups, with output to a non-tty
http://www.gratisexam.com/

You might also like