Book Review: CompTIA Linux+ Certification Study Guide
For all of you hungry certification seekers, today on the menu we have Brian Barber’s CompTIA Linux+ Certification Study Guide (Syngress, 1st ed., 2009, ISBN: 1597494828). The CompTIA Linux+ certification, as you may or may not know, is designed for novice sysadmins with six to twelve months of Linux experience. Mr. Barber’s book is supposed to help you prepare for the certification exam, but that’s unlikely to be the case due to a multitude of typos you will find in this book along with a considerable amount of incorrect technical information.
Be an Amazon affiliate marketer! Build amazon affiliate sites that earn commissions every month from free search engine traffic. You can do amazon associates training.
As is my habit when reading study guides, I opened this book in the middle and took a look at the “Self Test” sections at the end of chapters six (BASH shell) and seven (installing applications). Each test contains fifteen questions and for these questions the author provided at least six answers that are partially or fully incorrect. This means Mr. Barber would just barely pass this exam if he was answering his own questions. Let’s take a look at some of the issues that baffled the author of this book.
In chapter 6, question 6 (p. 195) the author asks what needs to be done after updating the ntp.conf file with new NTP server address. The author gives four options to choose from:
A. Nothing. The ntp service automatically detects the change and will start using your new time source.
B. Use chkconfig -d ntp to turn off the service, then chkconfig -a ntp to turn it back on with the new settings.
C. Use the init scripts to stop -/etc/init.d/ntp stop — then start -/etc/init.d/ntp start — the service with the new configuration.
D. Use the init scripts to restart the service -/etc/init.d/ntp restart
The correct answer, of course, is “C”, but the author provides two “correct” answers in the answer key: C and D. Apparently the author is not aware that the “restart” option for the ntp startup script is only available in some flavors and versions of Linux. It should also be mentioned that the author expects you to pick all applicable options from the list of possible answers. He just forgot to mention this.
Another mystery is the purpose of the hyphen that precedes “/etc” in the author’s examples. If you leave this hyphen in place, then none of these commands will actually work:
icebox:~ # -/etc/init.d/ntp restart -bash: -/etc/init.d/ntp: No such file or directory icebox:~ # /etc/init.d/ntp restart Shutting down network time protocol daemon (NTPD) done Starting network time protocol daemon (NTPD) done
Question 10 in the same chapter goes something like this: “You want to learn more about all the hidden files in your home directory. What command could you use to see them?” And the choices are:
A. ls -A
B. ls .*
C. ls -a
D. ls .
The correct answers are “A” and “C”, but the author also lists “B” among the right answers. With certain shell versions “ls .” will list contents of hidden subfolders as well as the contents of the parent directory (“.” includes “..”, which is a metalink for the parent folder) and so option “B” is not a good choice.
Chapter six again, question 11: “You are documenting your system and want a file named user_dirs that contains a current list of all the user home directories. What is a quick way of doing this?” The options given are:
A. echo /home > user_dirs
B. ls /home > user_dirs
C. ls /home >> user_dirs
D. cp /home >> user_dirs
The right answer is “B” but the author also lists “C” as the correct response. The “>>” syntax appends the output of a command to a file. Therefore, if you already have a file called “user_dirs” in that folder (let’s say a colleague of yours found Mr. Barber’s book on your desk and decided to try some of the commands), using option “C” will leave you with a mess. Technically, option “C” is not a wrong way of doing this, just a very clumsy one.
Moving on to chapter seven, question #8:
“One of your servers has had a drive failure and you need to restore the data from last night’s backup, which is a compressed tar archive. You generated the archive of everyone’s home directories with the commands:
tar czvf work.tgz home
You have copied the file to /tmp on the new drive and executed the command
tar xzvf work.tgz
from that directory. To what location would the home directories be restored?”
I am not even going to list the possible answers as the question itself is wrong. First, the editor overlooked the missing space between “cd” and “/home”. Second, if you are already in /home, then running “tar czvf work.tgz home” will backup absolutely nothing (or /home/home, if there is such a directory):
icebox:~ # ls /home user1 user2 user3 icebox:~ # cd /home icebox:/home # tar czvf work.tgz home tar: home: Cannot stat: No such file or directory tar: Error exit delayed from previous errors
The correct syntax for this command would have been: cd /home ; tar czvf /tmp/work.tgz . or tar czvf /tmp/work.tgz /home
Same chapter, question 10: “You have downloaded source code for a new Web program into /tmp and have read the INSTALL file that came with it. The INSTALL file says you have to run the command: ./configure –prefix=targetdirectory Where do you think the makefile will be created?”
The choices given are:
A. In the current directory
B. In a subdirectory called targetdirectory from the current directory
C. In a directory called targetdirectory in your home directory
D. Nowhere as the makefile is created by make
The correct answer is “E”: nowhere, as the file is called Makefile and not makefile. Forgetting the uppercase distinction, the correct answer would be “A” – with most “configure” scripts the makefile will be created in the current directory. However, the author gives answer “B” as the correct one. This is wrong. The “–prefix” option for the configure script designates the target directory for installing architecture-independent files after compiling. Here’s an example using “configure” from GNU’s “wget” source code on openSuSE 11.1:
icebox:/tmp/wget/wget-1.12 # ls ABOUT-NLS ChangeLog INSTALL Makefile.in aclocal.m4 configure doc maint.mk po util AUTHORS ChangeLog.README MAILING-LIST NEWS autogen.sh configure.ac lib md5 src windows COPYING GNUmakefile Makefile.am README build-aux configure.bat m4 msdos tests # notice ^ no Makefile yet icebox:/tmp/wget/wget-1.12 # ./configure --prefix=/tmp/wget configure: configuring for GNU Wget 1.12 checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk ... config.status: executing po-directories commands config.status: creating po/POTFILES config.status: creating po/Makefile icebox:/tmp/wget/wget-1.12 # ls ABOUT-NLS ChangeLog INSTALL Makefile.am README build-aux configure doc maint.mk po util AUTHORS ChangeLog.README MAILING-LIST Makefile.in aclocal.m4 config.log configure.ac lib md5 src windows COPYING GNUmakefile Makefile NEWS autogen.sh config.status configure.bat m4 msdos tests # Voila! The Makefile is in the current directory despite the --prefix option.
As you can see, the Makefile was created in the current directory and not in the directory specified by the “–prefix” option.
The path given to the configure script using the “–prefix” option is inserted into the Makefile and is used by the “make install” command. The Makefile itself is created in the current directory:
icebox:/tmp/wget/wget-1.12 # grep prefix Makefile | grep "/tmp/wget" prefix = /tmp/wget
And I left the best for last. Same old chapter seven, question #14: “You are compiling source code for installation and you want to string all of the required commands together to run while you are going downstairs to grab a coffee so that the binary file is ready when you return. What answer below has the syntax that will not work?”
And the choices are:
A. ./configure; make; make install
B. ./configure / make / make install
C. ./configure && make && make install
D. ./configure | make | make install
The “correct” answer provided by the author is “B”. While option “B” will definitely not work, neither will option “D”. Option “C” will not work in all versions of all common Linux shells. Therefore, the only consistently-reliable syntax for queuing multiple commands in a Unix shell uses the semicolon. Clearly, the author needs a refresher course on the purpose and applications of the “pipe”. Mr. Barber and his technical editor are under the impression that option “D” will actually work. Here’s proof that it will not:
icebox:/tmp/wget/wget-1.12 # ./configure | make There seems to be no Makefile in this directory. You must run ./configure before running `make'. make: *** [abort-due-to-no-makefile] Error 1 ./configure: line 2288: printf: write error: Broken pipe
The pipeline (“|”) supplies stdout of the first process as stdin for the following process. The stdout produced by the configure script cannot be used as stdin for the make command as it only contains status of operations performed by the configure script and not the actual product of those operations. The make command needs to use the Makefile created by the configure script.
So there you have it: I went over just 30 questions from only two chapters of this book and found serious problems with six of the questions. That’s a 20% error rate on the part of the author and his technical editor. A possible reason for such poor attention to detail came to light when I glanced through the author’s credentials: lots of Microsoft certifications and a lonely CompTIA Linux+. Basically, Mr. Barber is a Windows sysadmin with a beginner’s Linux certification.
If you are a Linux novice, the “CompTIA Linux+ Certification Study Guide” will confuse you. If, on the other hand, you are already an experienced Linux sysadmin, this book will just annoy you with its countless typos and poor grasp of Linux. In case you still want to pursue CompTIA’s Linux+ certification, keep this in mind: the author of this book has got one, so don’t work too hard. Either way, this book is best left on the shelf of your local book store where it will eventually get covered by a thick layer of dust until it is replaced by the second edition and, hopefully, this time the author and his editor will have paid attention to the stupid details.