Table of Contents
If you feel you are an expert in the subject area for this LPI topic and would like to write this chapter please email the author of the LPI study guide to communicate your intentions. Authors should be LPI certified or hold a similar certification in a related subject.
Please adopt only one chapter at a time and plan to finish the chapter within thirty days of adopting it.
More information about the study guide can be found at: http://www.happy-monkey.net/LPI/
The structure of chapters within the study guide needs to be consistent. The following structure may be used as a guide. Authors are also encouraged to view the chapter covering "Hardware & Architecture" as a template.
Author Name
This is to ensure that authors get credit for their work. Please include your level of LPI certification after your name. If there are other appropriate certifications, please include these as well. For example, someone writing a chapter on networking might include the fact that they have a Cisco certification in addition to the LPI certification like this: "Joe Smith, LPIC-1, CCNA".
A Brief Look At The Objectives
Each chapter should start with a high-level look at the LPI testing objectives. Within this "Brief Look" section there should be hyperlinks to sources of additional information. For example, one might say, "The networking section of the exam requires familiarity requires familiarity with IP addresses and subnet masks." The phrases 'IP addresses' and 'subnet masks' should be hyperlinked to additional information. Wikipedia is the prefered source of external information, but it is also helpful to link to man pages for specific commands.
Detailed Discussion
Each one of the LPI exam objectives should receive a section
for more detailed coverage of the objective and how it relates to
Linux and the LPI exam. A good way to do this is by using hands-on
exercises and examples from real-world Linux systems whenever
possible. For example, when discussing a configuration file in
/etc, give a sample of what a typical file
might look like and encourage the reader to cat
the file on their own system.
Objectives may be grouped together when it is logical to do so.
Practice Questions
At the end of each chapter there should be a section dedicated to practice questions that cover the exam objectives. These should not be verbatim questions from the exam! The idea is to let readers test their mastery of the knowledge in each chapter and get a feel for the exam format, not to help them cheat. Anyone intentionally submitting verbatim questions will be reported to the LPI and risks losing their certification.
The LPI Study Guide is written using DocBook XML markup. This allows the guide to be published in HTML, PDF and other formats using the same source document. Those familiar with DocBook are encouraged to submit chapters this way. Be sure to use markup for commands and filenames in addition to sections. Use the chapter on "Hardware & Architecture" as a template.
For those not familiar with DocBook should submit chapters in plain text in a format similar to the example below.
A Brief Look At The Objectives Successful completion of the Hardware & Architecture section of the LPI exam requires familiarity with Personal Computer (PC) expansion cards [http://url-to-wikipedia/expansion-cards]... Next-Section-Title More text...
Please email the author of the LPI study guide with any other questions not covered.
Given the command ls | tee dir, where will the directory listing be sent?
To standard output and to standard error
To standard output and to a file called tee
To standard output and to a file called dir
To a file called tee and to a file called dir
A prospective employer is asking you to send a text file describing your qualifications in two-hundred words or less. What command will allow you to count the number of words in your text file?
Which command will add the directory /opt/bin to the end of your BASH shell's search path?
PATH=$PATH:/opt/bin
PATH=`cat $PATH /opt/bin`
PATH=/opt/bin
PATH="PATH:/opt/bin"
The command unset FOO does what?
Makes $FOO equal to zero
Makes $FOO equal to a null string
Removes any attributes assigned to FOO by typeset
Removes the shell variable FOO
Which of the following will send the standard error of
mkdir /tmp/foo to
/dev/null?
mkdir /tmp/foo </dev/null
mkdir /tmp/foo >/dev/null
mkdir /tmp/foo 1>/dev/null
mkdir /tmp/foo 2>/dev/null
Which of the following will display the string "oops" when the command mkdir /tmp/bar fails?
mkdir /tmp/bar && echo "oops"
mkdir /tmp/bar || echo "oops"
mkdir /tmp/bar ; echo "oops"
mkdir /tmp/bar | echo "oops"
What is the default signal for the kill command if no signal is specified as a command-line option?
SIGHUP
SIGINT
SIGKILL
SIGTERM
What signal can be used with the kill command to end processes that do not respond to the default signal?
SIGHUP
SIGINT
SIGKILL
SIGTERM
What command can be used to start a program with a lower scheduling priority?
Which of the following commands can be used to change the scheduling priority of a running process? (choose two)
kill
ps
renice
top
The command ls | tee dir will send a directory listing to standard output and to the file called dir, so the correct answer is C. Answer A is wrong because the tee command does not send anything to standard error. Answer B is incorrect, because pipes send output to commands, not files. Answer D is incorrect, the proper way to send ls output to multiple files would be ls | tee file1 file2.
The wc command allows you to count the number of words in a text file.
The correct answer is A. Answer B is incorrect because cat is used to concatenate files, not variables and strings. Answer C is incorrect, it will ignore the previous PATH and set PATH to /opt/bin only. Answer D is incorrect because there is no $ in front of PATH to indicate it is a variable.
The correct answer is D, the command unset FOO removes the shell variable FOO. Answers A and B are incorrect since they refer to assigning values which is not what unset does. Answer C is incorrect since variable attributes are removed by using typeset with a plus instead of a minus in front of the attribute.
The correct answer is D, command
2>/dev/null redirects standard error to
/dev/null. Remember the file descriptor for
standard error is 2. Answer A is incorrect since it redirects standard
input. Answers B and C both redirect standard output and are incorrect
as well.
The correct answer is B, command || echo "oops" will display the string "oops" if command should fail. Answer A is incorrect since it will display "oops" when command is successful. Answer C is incorrect since it wil display "oops regardless of the success or failure of command. Answer D is incorrect, since a single "|" character is a pipeline not a compound command operator.
The default signal for the kill command is SIGTERM.
SIGKILL or -9 can be used when processes do not respond to the default SEGTERM.
The nice command can be used to start programs with lower scheduling priority. It can also be used to start programs with a higher priority, but only the superuser can do this.
The renice and top commands, answers C and D, can be used to change the priority of a running process. Answer A is incorrect, because kill is used to send signals to a process not change its scheduling priority. Answer B is incorrect, because ps only shows processes and cannot manipulate them.
The commands you can expect to see on the exam are listed on LPI's web site under Exam 101: Detailed Objectives. Be sure that you understand all of these commands.
Be sure that you are familiar with all of the commands listed for Topic 103 of the 101 exam objectives. Use the Linux manual pages and The GNU Linux Tools Summary to help you learn about various commands you are unfamiliar with. Practice using the commands to perform various tasks on your system. If you are studying in a group make up sample tasks as challenges to the other group members.
See the BASH man page and info page for more information about how to redirect input, output and standard error as well as compound commands. Log into a Linux sytem and try entering commands like the answers shown above. Enter both correct and incorrect answers and view the results.
See the man pages for ps(1), kill(1), nice(1), renice(1), signal(7) and top(1). Be sure you understand the difference between nice and renice and when it is appropriate to use one instead of the other. Pay attention to the priority adjustment numbers that can be used with nice and renice particularly what range of numbers is higher and which users are allowed to set higher priorities.
For more information on foo and bar refer to the wikipedia entry for foobar. To the author's knowledge the LPI exams do not feature any questions that use the terms foo or bar. However, many Linux references use these terms in examples and you may encounter them when studying.