| | Copyright | |
| | Trademark Information | ii |
| | Preface | xxv |
| | | About the Authors | xxv |
| | | About the Book | xxvi |
| | | Organization of the Book | xxvii |
| | | Layout of the Chapters | xxvii |
| | | A Guide for Teachers | xxviii |
| | | Nomenclature | xxix |
| | | References to Other Books | xxix |
| | | Source Code Availability Online | xxx |
| | | Acknowledgments | xxx |
| | Chapter 1. What Is Linux? | 1 |
| | | Motivation | 1 |
| | | Prerequisites | 1 |
| | | Objectives | 1 |
| | | Presentation | 1 |
| | | Section 1.1. Computer Systems | 2 |
| | | Section 1.2. Hardware | 3 |
| | | Section 1.3. Operating System | 4 |
| | | Section 1.4. Software | 5 |
| | | Section 1.5. Sharing Resources | 5 |
| | | Section 1.6. Communication | 6 |
| | | Section 1.7. Utilities | 7 |
| | | Section 1.8. Programmer Support | 7 |
| | | Section 1.9. Standards | 8 |
| | | Section 1.10. Linux Lineage | 8 |
| | | Section 1.11. Linux Packaging | 11 |
| | | Section 1.12. The Linux and UNIX Philosophy | 12 |
| | | Section 1.13. Linux Features | 13 |
| | | Section 1.14. The Rest of This Book | 14 |
| | | Chapter Review | 15 |
| | Chapter 2. Installing Your Linux System | 17 |
| | | Motivation | 17 |
| | | Prerequisites | 17 |
| | | Objectives | 17 |
| | | Presentation | 17 |
| | | Section 2.1. Introduction | 18 |
| | | Section 2.2. Make Sure Your Hardware Will Support Linux | 18 |
| | | Section 2.3. Choose Your Linux Distribution | 20 |
| | | Section 2.4. Consider Optional Software Packages | 23 |
| | | Section 2.5. Design Your System | 28 |
| | | Section 2.6. Get Linux | 33 |
| | | Section 2.7. Install Linux | 35 |
| | | Chapter Review | 39 |
| | Chapter 3. GNU Utilities for Nonprogrammers | 41 |
| | | Motivation | 41 |
| | | Prerequisites | 41 |
| | | Objectives | 41 |
| | | Presentation | 41 |
| | | Utilities | 42 |
| | | Shell command | 42 |
| | | Section 3.1. Obtaining an Account | 42 |
| | | Section 3.2. Logging In | 42 |
| | | Section 3.3. Shells | 43 |
| | | Section 3.4. Running a GNU Utility | 44 |
| | | Section 3.5. Input, Output, and Error Channels | 45 |
| | | Section 3.6. Obtaining Online Help: man | 45 |
| | | Section 3.7. Special Characters | 47 |
| | | Section 3.8. Setting Your Password: passwd | 49 |
| | | Section 3.9. Logging Out | 50 |
| | | Section 3.10. Poetry in Motion: Exploring the File System | 50 |
| | | Section 3.11. Printing Your Shell's Current Working Directory: pwd | 52 |
| | | Section 3.12. Absolute and Relative Pathnames | 52 |
| | | Section 3.13. Creating a File | 54 |
| | | Section 3.14. Listing the Contents of a Directory: ls | 55 |
| | | Section 3.15. Listing the Contents of a File: cat/more/head/tail | 56 |
| | | Section 3.16. Renaming a File: mv | 58 |
| | | Section 3.17. Creating a Directory: mkdir | 58 |
| | | Section 3.18. Moving to a Directory: cd | 59 |
| | | Section 3.19. Copying a File: cp | 60 |
| | | Section 3.20. Editing a File: vim | 61 |
| | | Section 3.21. Deleting a Directory: rmdir | 62 |
| | | Section 3.22. Deleting a File: rm | 62 |
| | | Section 3.23. Printing a File: lp/lpstat/cancel | 64 |
| | | Section 3.24. Printing a File: lpr/lpq/lprm | 65 |
| | | Section 3.25. Counting Words in a File: wc | 67 |
| | | Section 3.26. File Attributes | 68 |
| | | Section 3.27. Groups | 72 |
| | | Section 3.28. Listing Your Groups: groups | 73 |
| | | Section 3.29. Changing a File's Group: chgrp | 73 |
| | | Section 3.30. Changing a File's Permissions: chmod | 74 |
| | | Section 3.31. Changing a File's Owner: chown | 76 |
| | | Section 3.32. Changing Groups: newgrp | 76 |
| | | Section 3.33. Poetry in Motion: Epilogue | 77 |
| | | Section 3.34. Determining Your Terminal's Type: tset | 77 |
| | | Section 3.35. Changing a Terminal's Characteristics: stty | 80 |
| | | Section 3.36. Editing a File: vim | 82 |
| | | Section 3.37. Editing a File: emacs | 93 |
| | | Section 3.38. Electronic Mail: mail | 99 |
| | | Chapter Review | 103 |
| | Chapter 4. GNU Utilities for Power Users | 107 |
| | | Motivation | 107 |
| | | Prerequisites | 107 |
| | | Objectives | 107 |
| | | Presentation | 107 |
| | | Utilities | 107 |
| | | Section 4.1. Introduction | 108 |
| | | Section 4.2. Filtering Files: grep, egrep, fgrep, and uniq | 109 |
| | | Section 4.3. Sorting Files: sort | 113 |
| | | Section 4.4. Comparing Files: cmp and diff | 116 |
| | | Section 4.5. Finding Files: find | 119 |
| | | Section 4.6. Archiving Files: cpio, tar, and dump/restore | 121 |
| | | Section 4.7. Scheduling Commands: crontab and at | 128 |
| | | Section 4.8. Programmable Text Processing: gawk | 132 |
| | | Section 4.9. Hard and Soft Links: ln | 137 |
| | | Section 4.10. Identifying Shells: whoami | 139 |
| | | Section 4.11. Substituting a User: su | 139 |
| | | Section 4.12. Transforming Files | 140 |
| | | Section 4.13. Looking at Raw File Contents: od | 148 |
| | | Section 4.14. Mounting File Systems: mount and umount | 149 |
| | | Section 4.15. Identifying Terminals: tty | 150 |
| | | Section 4.16. Timing Execution: time | 151 |
| | | Section 4.17. Rolling Your Own Programs: Perl | 152 |
| | | Chapter Review | 164 |
| | Chapter 5. The Linux Shells | 167 |
| | | Motivation | 167 |
| | | Prerequisites | 167 |
| | | Objectives | 167 |
| | | Presentation | 168 |
| | | Utilities | 168 |
| | | Shell Commands | 168 |
| | | Section 5.1. Introduction | 168 |
| | | Section 5.2. Selecting a Shell | 169 |
| | | Section 5.3. Shell Operations | 170 |
| | | Section 5.4. Executable Files Versus Built-in Commands | 170 |
| | | Section 5.5. Metacharacters | 171 |
| | | Section 5.6. Redirection | 172 |
| | | Section 5.7. Filename Substitution (Wildcards) | 174 |
| | | Section 5.8. Command Substitution | 178 |
| | | Section 5.9. Sequences | 178 |
| | | Section 5.10. Grouping Commands | 179 |
| | | Section 5.11. Background Processing | 180 |
| | | Section 5.12. Redirecting Background Processes | 181 |
| | | Section 5.13. Shell Programs (Scripts) | 182 |
| | | Section 5.14. Subshells or Child Shells | 183 |
| | | Section 5.15. Variables | 184 |
| | | Section 5.16. Quoting | 187 |
| | | Section 5.17. Here Documents | 187 |
| | | Section 5.18. Job Control | 188 |
| | | Section 5.19. Finding a Command: $PATH | 194 |
| | | Section 5.20. Superseding Standard Utilities | 195 |
| | | Section 5.21. Termination and Exit Codes | 196 |
| | | Section 5.22. Common Core Built-Ins | 197 |
| | | Chapter Review | 200 |
| | Chapter 6. The Bourne Again Shell | 203 |
| | | Motivation | 203 |
| | | Prerequisites | 203 |
| | | Objectives | 203 |
| | | Presentation | 203 |
| | | Shell Commands | 204 |
| | | Section 6.1. Introduction | 204 |
| | | Section 6.2. Startup | 204 |
| | | Section 6.3. Variables | 205 |
| | | Section 6.4. Command Shortcuts | 217 |
| | | Section 6.5. Tilde Substitution | 220 |
| | | Section 6.6. Redirection | 221 |
| | | Section 6.7. Command Substitution | 222 |
| | | Section 6.8. Arithmetic | 222 |
| | | Section 6.9. Conditional Expressions | 223 |
| | | Section 6.10. Control Structures | 226 |
| | | Section 6.11. Functions | 232 |
| | | Section 6.12. Menus: select | 236 |
| | | Section 6.13. Directory Access and the Directory Stack | 237 |
| | | Section 6.14. Job Control | 239 |
| | | Section 6.15. Command-Line Options | 242 |
| | | Chapter Review | 242 |
| | Chapter 7. The Korn Shell | 245 |
| | | Motivation | 245 |
| | | Prerequisites | 245 |
| | | Objectives | 245 |
| | | Presentation | 245 |
| | | Shell Commands | 245 |
| | | Section 7.1. Introduction | 246 |
| | | Section 7.2. Startup | 246 |
| | | Section 7.3. Variables | 248 |
| | | Section 7.4. Aliases | 255 |
| | | Section 7.5. History | 259 |
| | | Section 7.6. Editing Commands | 262 |
| | | Section 7.7. Arithmetic | 265 |
| | | Section 7.8. Tilde Substitution | 267 |
| | | Section 7.9. Menus: select | 267 |
| | | Section 7.10. Functions | 269 |
| | | Section 7.11. Job Control | 273 |
| | | Section 7.12. Enhancements | 276 |
| | | Section 7.13. Sample Project: junk | 290 |
| | | Section 7.14. Command-Line Options | 293 |
| | | Chapter Review | 293 |
| | Chapter 8. The C Shell | 295 |
| | | Motivation | 295 |
| | | Prerequisites | 295 |
| | | Objectives | 295 |
| | | Presentation | 295 |
| | | Shell Commands | 296 |
| | | Section 8.1. Introduction | 296 |
| | | Section 8.2. Startup | 296 |
| | | Section 8.3. Variables | 298 |
| | | Section 8.4. Expressions | 303 |
| | | Section 8.5. Filename Completion | 307 |
| | | Section 8.6. Command Editing | 307 |
| | | Section 8.7. Aliases | 307 |
| | | Section 8.8. History | 310 |
| | | Section 8.9. Control Structures | 314 |
| | | Section 8.10. Sample Project: junk | 321 |
| | | Section 8.11. Enhancements | 323 |
| | | Section 8.12. Built-Ins | 328 |
| | | Section 8.13. The Directory Stack | 330 |
| | | Section 8.14. Command-Line Options | 332 |
| | | Chapter Review | 333 |
| | Chapter 9. Networking and the Internet | 335 |
| | | Motivation | 335 |
| | | Prerequisites | 335 |
| | | Objectives | 335 |
| | | Presentation | 335 |
| | | Commands | 336 |
| | | Section 9.1. Introduction | 336 |
| | | Section 9.2. Building a Network | 336 |
| | | Section 9.3. Internetworking | 338 |
| | | Section 9.4. Identifying Network Users | 344 |
| | | Section 9.5. Communicating with Network Users | 347 |
| | | Section 9.6. Distributing Data | 350 |
| | | Section 9.7. Distributed Processing | 354 |
| | | Section 9.8. Evolution of the Internet | 360 |
| | | Section 9.9. Using Today's Internet | 371 |
| | | Chapter Review | 373 |
| | Chapter 10. The Linux Desktop | 375 |
| | | Motivation | 375 |
| | | Prerequisites | 375 |
| | | Objectives | 375 |
| | | Presentation | 375 |
| | | Utilities | 376 |
| | | Section 10.1. Introduction | 376 |
| | | Section 10.2. X Servers | 377 |
| | | Section 10.3. Desktop Environments | 379 |
| | | Section 10.4. Window Managers | 381 |
| | | Section 10.5. Widgets | 385 |
| | | Section 10.6. Desktop Operation | 387 |
| | | Section 10.7. Client Applications | 389 |
| | | Section 10.8. Standard X Client Arguments | 391 |
| | | Section 10.9. Advanced Topics | 392 |
| | | Chapter Review | 397 |
| | Chapter 11. C Programming Tools | 399 |
| | | Motivation | 399 |
| | | Prerequisites | 399 |
| | | Objectives | 399 |
| | | Presentation | 399 |
| | | Utilities | 400 |
| | | Section 11.1. The C Language | 400 |
| | | Section 11.2. C Compilers | 400 |
| | | Section 11.3. Single-Module Programs | 401 |
| | | Section 11.4. Multimodule Programs | 404 |
| | | Section 11.5. Archiving Modules: ar | 408 |
| | | Section 11.6. Managing Dependencies: make | 411 |
| | | Section 11.7. The GNU Profiler: gprof | 418 |
| | | Section 11.8. Debugging a Program: gdb | 419 |
| | | Section 11.9. When You're Done: strip | 429 |
| | | Chapter Review | 429 |
| | Chapter 12. Systems Programming | 431 |
| | | Motivation | 431 |
| | | Prerequisites | 431 |
| | | Objectives | 431 |
| | | Presentation | 431 |
| | | Utilities | 432 |
| | | System calls and library functions | 432 |
| | | Section 12.1. Introduction | 432 |
| | | Section 12.2. Error Handling: perror () | 434 |
| | | Section 12.3. Regular File Management | 436 |
| | | Section 12.4. Process Management | 473 |
| | | Section 12.5. Signals | 486 |
| | | Section 12.6. Interprocess Communication | 500 |
| | | Chapter Review | 528 |
| | Chapter 13. Linux Internals | 533 |
| | | Motivation | 533 |
| | | Prerequisites | 533 |
| | | Objectives | 533 |
| | | Presentation | 534 |
| | | Section 13.1. Introduction | 534 |
| | | Section 13.2. Kernel Basics | 534 |
| | | Section 13.3. The File System | 541 |
| | | Section 13.4. Process Management | 552 |
| | | Section 13.5. Virtual Memory Management | 556 |
| | | Section 13.6. Input and Output | 560 |
| | | Section 13.7. Interprocess Communication | 569 |
| | | Chapter Review | 573 |
| | Chapter 14. System Administration | 575 |
| | | Motivation | 575 |
| | | Prerequisites | 575 |
| | | Objectives | 575 |
| | | Presentation | 575 |
| | | Utilities | 576 |
| | | Section 14.1. Introduction | 576 |
| | | Section 14.2. Becoming the Super-User | 576 |
| | | Section 14.3. Starting Linux | 578 |
| | | Section 14.4. Stopping Linux | 580 |
| | | Section 14.5. Maintaining the File System | 580 |
| | | Section 14.6. Maintaining User Accounts | 584 |
| | | Section 14.7. Installing New Software | 587 |
| | | Section 14.8. Peripheral Devices | 587 |
| | | Section 14.9. The Network Interface | 588 |
| | | Section 14.10. Automating Tasks | 589 |
| | | Section 14.11. Tunable Kernel Parameters | 590 |
| | | Section 14.12. Security Issues | 591 |
| | | Chapter Review | 592 |
| | Appendix A. | 595 |
| | | Section A.1. Regular Expressions | 595 |
| | | Section A.2. Extended Regular Expressions | 597 |
| | | Section A.3. Modified Backus-Naur Notation | 597 |
| | | Section A.4. Utilities and Shell Built-In Commands | 598 |
| | | Section A.5. System Calls and Library Functions | 605 |
| | Bibliography | 609 |
| | Index | |