Book: LPI Linux Certification in a Nutshell Section: Chapter 8. Exam 101 Review Questions and Exercises
1. ### 8.4 Documentation (Topic 1.8) #### 8.4.1 Review questions Describe the `PAGER` environment variable. How does it affect the man facility? If `PAGER` is not set, how does man display output? Does this environment variable affect the info facility? In response to your query on a library function, man returns a page on an identically named user command. Why does this happen? How do you display the page for the function and not the command? How do you display both? Where are the HOWTO documents located on a typical Linux system? Name the program that displays GNU Texinfo pages. What is probably the most important skill you can offer to end users while staffing a helpdesk service? #### 8.4.2 Exercises ##### 8.4.2.1 Exercise 1.8 -1. man and /usr/doc Run a man inquiry as follows:
       $ man -a -Pless mkfifo
   There is both a mkfifo command and a mkfifo function. You'll be looking at the mkfifo command from section 1 of the manual. Note `MKFIFO(1)` at the top of the page. Press the letter q to terminate the pager program. The pager is then invoked again and displays the mkfifo function from section 3 of the manual. Note `MKFIFO(3)` at the top of the page. Run the man command again, using the -Pmore option as follows:
       $ man -a -Pmore mkfifo
2. What differences do you see in the output? What does the -P option do? Run another man inquiry as follows:
       $ man -d ln
   What output do you get from man? What is the -d option? Did you see information on the ln command? Now examine the man configuration file:
       $ less /etc/man.config
3. Notice how the contents of this file coincide with the result you received from the -d option. Enter the following command:
       $ locate whois
   Note that locate shows two commands that match whois, along with a directory and a README file. Now use the stat program to evaluate the two commands:
       $ stat /usr/bin/whois /usr/bin/fwhois
   Examine the inode number for both files. An inode is a unique identifier, or node, of your Linux filesystem. The fact that these two files show the same inode indicates that they are links to the same file. That is, one file has two directory entries with different names. This means that you'll be running the same program regardless of which command name you use. Next, examine the README file that locate reported:
       $ less /usr/doc/fwhois-1.00/README
   Your version may be different. Now look for a manpage and an info page for this program:
       $ man fwhois
       $ info fwhois
4. As you can see, the program author chose not to offer a manpage or an info page for fwhois, leaving the README in /usr/doc as the sole documentation for the program. Suppose you are Spanish-speaking and would like to learn about how to use Linux in your native tongue. Try the following commands:
       $ man spanish
       $ info spanish
       $ find /usr/doc -name "*anish*"
1. 2. Do the man and info utilities have anything to offer on Spanish? Did you find a document in /usr/doc that concerns Spanish? ##### 8.4.2.2 Exercise 1.8-2. Internet documentation resources Using a Usenet news reader program, subscribe to comp.os.linux and comp.os.linux.advocacy. Of these, which has the highest volume, as indicated by the number of unread messages? Do you see messages of interest in these groups? ##### 8.4.2.3 Exercise 1.8-3. Creating system documentation Using a text editor, create a text file named mycmd.1. Complete the following steps: This page is intended as an example of local documentation, so store it in /usr/local/man/man1/mycmd.1. Are there other files in this directory already? Why or why not? What happens when you execute the command:
          $  man mycmd
Did you get the result you expected? Experiment with the formatting macros by adding italic and bold both on a per-line basis (`.B`) and an in-line basis (`\fB`). ##### 8.4.2.4 Exercise 1.8-4. Acting as a Linux helpdesk Suppose you are a helpdesk technician in a mixed-systems office, and you are relatively new to Linux. A user calls your helpdesk with a general question about Linux system shutdown. He indicates that he's heard from Unix gurus that using the halt command could be unsafe. He also reports getting frustrated with Windows NT users who use the Ctrl-Alt-Del key combination on his system console, which causes his Linux server to shut down. He asks for specific information on: How to safely shut down Linux. How to allow nonsuperusers the ability to shut down cleanly. How to disable the Ctrl-Alt-Del shutdown. Let's further assume you don't know how to answer these questions and that you have access to system documentation. Complete the following steps: Use the man facility to investigate the halt command. Based on what you find there, answer the following: In what section of the manual is halt located? Why? Determine if it is "safe" to use halt to shut down Linux. What caused the Unix gurus to instruct the caller that using halt was not safe? Determine if it would still be safe if the user uses the -n option to halt. Is it appropriate to use halt on a multiuser system to which others are logged in? Use man on the other commands referred to by the halt manpage in the SEE ALSO section. Evaluate the other commands: Which commands can be used to shut down the system in place of halt? Which commands would be the most appropriate for shutting down a multiuser system? From what you see in the manpages: Where is the Ctrl-Alt-Del system shutdown configured? Explain how to disable it. Do you need to reboot to enable the change? If so, why? How can you configure the system to allow specified nonsuperusers to shut down cleanly? If you use the info command, are you provided with additional information? After successfully following your instructions, the user calls again. This time he is puzzled by error messages that are produced when his users attempt a clean shutdown from multiuser mode using the shutdown command without arguments. Re-evaluate the manpages in question. Are there any clues to common problems? (Hint: see BUGS.) State the typical shutdown command to issue from multiuser mode.