---------------------------------------------------- Chapter 2 Reading Guide - A Practical Guide to Linux ---------------------------------------------------- -IAN! idallen@ncf.ca Here is a Reading Guide and some review questions for Chapter 2 "Getting Started". You will find questions similar to these on tests and exams. Omit material related to the GUI and X Windows (e.g. xman, tkman). Omit material related to printing (e.g. lpr). Omit material related to the "joe" editor (p.32-36). Omit material related to the "info" utility. Floppix doesn't include the Linux "info" command. Substitute the file /etc/passwd for the missing file /etc/termcap (text p.37) when practicing on ACADUNIX. - "The best way to learn is by doing." Which chapters of the text are suitable for "learning by doing"? - True or False: Making a mistake as an ordinary user while learning Unix or Linux may damage the Unix system and crash it. - True or False: Making a mistake as the user "root" while learning Unix or Linux may damage the Unix system and crash it. - What are the answers to the relevant questions on page 20 on Floppix? on ACADUNIX? You may find the output of the stty command helpful in determining the default erase, line kill, and word erase (werase) characters. Try this: $ stty all Your terminal type (termcap or terminfo name) is stored in the $TERM shell variable. Page 928 shows how to display $TERM. Note that $TERM is upper-case. - Read the first three-line paragraph under the "Notes" heading on page 867. The default Korn shell (ksh) on ACADUNIX also prevents some actions of the stty command from working. - On Floppix, test each of the erase, word erase, and line kill characters. Do they all work as expected? Start up the C Shell "csh". Test the three characters again. Any differences? Start up the Bourne shell "sh". Any differences? (Type "exit" to exit a shell.) - What is the difference between a command (or utility) and a command line? - True or False: To avoid a syntax error you must type in the same prompt character as used by the shell at the beginning of all your Unix command lines, as illustrated in the textbook by examples such as: $ vi memo.1204 This example shows that you must type the dollar sign in front of all commands that you type into this shell. (To exit "vi", type :q! ) - True or False: You can end command lines in Unix either by using the TAB key, the RETURN key, or clicking the mouse. - True or False: The first prompt you see after logging in to a Unix system is almost always a text editor, such as "joe" or "vi". - True or False: The name of the Unix password command has 6 letters. - How many virtual consoles are available on Algonquin's ACADUNIX Unix system? - How many virtual consoles are configured into Floppix? - List three ways you can "back up" while typing a command, to erase characters that you have typed. Given the three shells "ksh", "csh", and "sh" on ACADUNIX, which shells permit all three characters to function as expected? - How do you interrupt/abort a command that is in progress? - ACADUNIX also has the open source "less" command that is available on Linux to paginate output. If "less" were missing, what similar command could you use instead to paginate output to your screen one page at a time? - What is the name of the command that displays system documentation? - What command line do you type to get the system documentation that is related to the command that gives you the system documentation? - If you say "man ksh" on ACADUNIX and then type the single letter "h" at the "(14%)" prompt at the bottom of the first screen, what happens? What program are you talking to when you type the "h"? (Hint: If this were Linux, it would be the "less" command doing the pagination. ACADUNIX does not use "less". What similar program does it use instead?) - In which of the nine traditional sections of the Unix manual do you find manual pages for user programs (also called "utilities" or "commands")? (see your text, p.30) Note: The ACADUNIX machine has its own special brand of "man" command that doesn't give pretty results. If possible use the "man" command on a real Linux system that has all the man pages online. - In which section of the manual do you find file formats (e.g. the format of the Unix /etc/passwd file)? (text, p.30) - What is the difference between the behaviour of "cat" and "ls"? NOTE: The file /etc/termcap (text p.37) is not present on ACADUNIX. You will find the huge Unix password file named /etc/passwd to be a good substitute for practicing the pagination commands. Note the spelling of the Unix password file name. - IBM has a proprietary pagination command named "pg" that works a lot like the open-source "less" command. We have installed the "less" command on ACADUNIX for you. If "less" were not available, you could try "pg" or even "more". - What error message is produced from these command lines on ACADUNIX: $ cat cans $ cat "screen door" Is this message more or less clear than the similar error message shown for "cat" in the box on page 36 in your text? - Explain the differences in the error messages for the following two command lines (note the subtle difference): $ cat "screen door" $ cat screen door - What does "white space" mean? - Why should you avoid shell "special characters" in file names, e.g. "*"? - What does "quoting" or "escaping" a shell special character mean? - Chapter Review Questions: On ACADUNIX or Linux: 1, 2, 3, 7, 8, 9, 11 NOTE: IBM has their own proprietary format for Unix man pages, unlike any other vendor. (The man pages are derived from an IBM proprietary document format.) For "real" Linux man pages, such as you would find on most any other Unix system except IBM AIX, telnet to a real Linux server or see the Linux Documentation links on the Web: * http://linux.ctyme.com * http://www2.linuxpakistan.net/man.php In Chapter 2, you learned a little about these Unix command names: passwd, man, ls, cat, less, more, rm You learned what these special characters do: ^D = CONTROL-D ^H = CONTROL-H ^L = CONTROL-L (bash shell only) ^U = CONTROL-U ^W = CONTROL-W ^C = CONTROL-C Most importantly, you learned that the "man" command can be a big help in finding out what commands do and what commands are available.