UNIX Power Tools, 3rd Edition - Lagout

Transcription

UNIX Power Tools, 3rd EditionBy Shelley Powers, Jerry Peek, Tim O'Reilly,Mike Loukides, et. al.Publisher :Pub Date :ISBN :Pages : Table ctober 20020-596-00330-71136The latest edition of this best-selling favorite is loaded with vitalinformation on Linux, Darwin, and BSD. Unix Power Tools 3rdEdition now offers more coverage of bash, zsh, and other newshells, along with discussions about modern utilities andapplications. Several sections focus on security and Internetaccess. There is a new chapter on access to Unix fromWindows, and expanded coverage of software installation andpackaging, as well as basic information on Perl and Python.777CopyrightHow to Use This BookPrefaceA Book for BrowsingLike an AlmanacLike a News MagazineLike a Hypertext DatabasePrograms on the WebAbout Unix VersionsCross-ReferencesWhat's New in the Third EditionTypefaces and Other ConventionsThe AuthorsThe Fine PrintRequest for CommentsAcknowledgments for the First EditionAcknowledgments for the Second EditionAcknowledgments for the Third EditionPart I: Basic Unix EnvironmentChapter 1. IntroductionSection 1.1. What's Special About Unix?Section 1.2. Power Grows on YouSection 1.3. The Core of UnixSection 1.4. Communication with UnixSection 1.5. Programs Are Designed to Work TogetherSection 1.6. There Are Many ShellsSection 1.7. Which Shell Am I Running?Section 1.8. Anyone Can Program the ShellSection 1.9. Internal and External CommandsSection 1.10. The Kernel and DaemonsSection 1.11. FilenamesSection 1.12. Filename Extensions

Section 1.13. WildcardsSection 1.14. The Tree Structure of the FilesystemSection 1.15. Your Home DirectorySection 1.16. Making PathnamesSection 1.17. File Access PermissionsSection 1.18. The Superuser (Root)Section 1.19. When Is a File Not a File?Section 1.20. ScriptingSection 1.21. Unix Networking and CommunicationsSection 1.22. The X Window SystemChapter 2. Getting HelpSection 2.1. The man CommandSection 2.2. whatis: One-Line Command SummariesSection 2.3. whereis: Finding Where a Command Is LocatedSection 2.4. Searching Online Manual PagesSection 2.5. How Unix Systems Remember Their NamesSection 2.6. Which Version Am I Using?Section 2.7. What tty Am I On?Section 2.8. Who's On?Section 2.9. The info CommandPart II: Customizing Your EnvironmentChapter 3. Setting Up Your Unix ShellSection 3.1. What Happens When You Log InSection 3.2. The Mac OS X Terminal ApplicationSection 3.3. Shell Setup Files — Which, Where, and WhySection 3.4. Login Shells, Interactive ShellsSection 3.5. What Goes in Shell Setup Files?Section 3.6. Tip for Changing Account Setup: Keep a Shell ReadySection 3.7. Use Absolute Pathnames in Shell Setup FilesSection 3.8. Setup Files Aren't Read When You Want?Section 3.9. Gotchas in set prompt TestSection 3.10. Automatic Setups for Different TerminalsSection 3.11. Terminal Setup: Testing TERMSection 3.12. Terminal Setup: Testing Remote Hostname and X DisplaySection 3.13. Terminal Setup: Testing PortSection 3.14. Terminal Setup: Testing Environment VariablesSection 3.15. Terminal Setup: Searching Terminal TableSection 3.16. Terminal Setup: Testing Window SizeSection 3.17. Terminal Setup: Setting and Testing Window NameSection 3.18. A .cshrc. HOST File for Per Host SetupSection 3.19. Making a "Login" ShellSection 3.20. RC FilesSection 3.21. Make Your Own Manpages Without Learning troffSection 3.22. Writing a Simple Manpage with the -man MacrosChapter 4. Interacting with Your EnvironmentSection 4.1. Basics of Setting the PromptSection 4.2. Static PromptsSection 4.3. Dynamic PromptsSection 4.4. Simulating Dynamic PromptsSection 4.5. C-Shell Prompt Causes Problems in vi, rsh, etc.

Section 4.6. Faster Prompt Setting with Built-insSection 4.7. Multiline Shell PromptsSection 4.8. Session Info in Window Title or Status LineSection 4.9. A "Menu Prompt" for Naive UsersSection 4.10. Highlighting and Color in Shell PromptsSection 4.11. Right-Side PromptsSection 4.12. Show Subshell Level with SHLVLSection 4.13. What Good Is a Blank Shell Prompt?Section 4.14. dirs in Your Prompt: Better Than cwdSection 4.15. External Commands Send Signals to Set VariablesSection 4.16. Preprompt, Pre-execution, and Periodic CommandsSection 4.17. Running Commands When You Log OutSection 4.18. Running Commands at Bourne/Korn Shell LogoutSection 4.19. Stop Accidental Bourne-Shell LogoutsChapter 5. Getting the Most out of Terminals, xterm, and X WindowsSection 5.1. There's a Lot to Know About TerminalsSection 5.2. The Idea of a Terminal DatabaseSection 5.3. Setting the Terminal Type When You Log InSection 5.4. Querying Your Terminal Type: qtermSection 5.5. Querying Your xterm Size: resizeSection 5.6. Checklist: Terminal Hangs When I Log InSection 5.7. Find Out Terminal Settings with sttySection 5.8. Setting Your Erase, Kill, and Interrupt CharactersSection 5.9. Working with xterm and FriendsSection 5.10. Login xterms and rxvtsSection 5.11. Working with ScrollbarsSection 5.12. How Many Lines to Save?Section 5.13. Simple Copy and Paste in xtermSection 5.14. Defining What Makes Up a Word for Selection PurposesSection 5.15. Setting the Titlebar and Icon TextSection 5.16. The Simple Way to Pick a FontSection 5.17. The xterm MenusSection 5.18. Changing Fonts DynamicallySection 5.19. Working with xclipboardSection 5.20. Problems with Large SelectionsSection 5.21. Tips for Copy and Paste Between WindowsSection 5.22. Running a Single Command with xterm -eSection 5.23. Don't Quote Arguments to xterm -eChapter 6. Your X EnvironmentSection 6.1. Defining Keys and Button Presses with xmodmapSection 6.2. Using xev to Learn Keysym MappingsSection 6.3. X Resource SyntaxSection 6.4. X Event TranslationsSection 6.5. Setting X Resources: OverviewSection 6.6. Setting Resources with the -xrm OptionSection 6.7. How -name Affects ResourcesSection 6.8. Setting Resources with xrdbSection 6.9. Listing the Current Resources for a Client: appresSection 6.10. Starting Remote X ClientsPart III: Working with Files and Directories

Chapter 7. Directory OrganizationSection 7.1. What? Me, Organized?Section 7.2. Many HomesSection 7.3. Access to DirectoriesSection 7.4. A bin Directory for Your Programs and ScriptsSection 7.5. Private (Personal) DirectoriesSection 7.6. Naming FilesSection 7.7. Make More Directories!Section 7.8. Making Directories Made EasierChapter 8. Directories and FilesSection 8.1. Everything but the find CommandSection 8.2. The Three Unix File TimesSection 8.3. Finding Oldest or Newest Files with ls -t and ls -uSection 8.4. List All Subdirectories with ls -RSection 8.5. The ls -d OptionSection 8.6. Color lsSection 8.7. Some GNU ls FeaturesSection 8.8. A csh Alias to List Recently Changed FilesSection 8.9. Showing Hidden Files with ls -A and -aSection 8.10. Useful ls AliasesSection 8.11. Can't Access a File? Look for Spaces in the NameSection 8.12. Showing Nonprintable Characters in FilenamesSection 8.13. Counting Files by TypesSection 8.14. Listing Files by Age and SizeSection 8.15. newer: Print the Name of the Newest FileSection 8.16. oldlinks: Find Unconnected Symbolic LinksSection 8.17. Picking a Unique Filename AutomaticallyChapter 9. Finding Files with findSection 9.1. How to Use findSection 9.2. Delving Through a Deep Directory TreeSection 9.3. Don't Forget -printSection 9.4. Looking for Files with Particular NamesSection 9.5. Searching for Old FilesSection 9.6. Be an Expert on find Search OperatorsSection 9.7. The Times That find FindsSection 9.8. Exact File-Time ComparisonsSection 9.9. Running Commands on What You FindSection 9.10. Using -exec to Create Custom TestsSection 9.11. Custom -exec Tests AppliedSection 9.12. Finding Many Things with One CommandSection 9.13. Searching for Files by TypeSection 9.14. Searching for Files by SizeSection 9.15. Searching for Files by PermissionSection 9.16. Searching by Owner and GroupSection 9.17. Duplicating a Directory TreeSection 9.18. Using "Fast find" DatabasesSection 9.19. Wildcards with "Fast find" DatabaseSection 9.20. Finding Files (Much) Faster with a find DatabaseSection 9.21. grepping a Directory TreeSection 9.22. lookfor: Which File Has That Word?Section 9.23. Using Shell Arrays to Browse DirectoriesSection 9.24. Finding the (Hard) Links to a File

SectionFilesinwithSection 9.25.9.26. FindingQuick findsthe -pruneCurrent DirectorySection 9.27. Skipping Parts of a Tree in findSection 9.28. Keeping find from Searching Networked FilesystemChapter 10. Linking, Renaming, and Copying FilesSection 10.1. What's So Complicated About Copying FilesSection 10.2. What's Really in a Directory?Section 10.3. Files with Two or More NamesSection 10.4. More About LinksSection 10.5. Creating and Removing LinksSection 10.6. Stale Symbolic LinksSection 10.7. Linking DirectoriesSection 10.8. Showing the Actual Filenames for Symbolic LinksSection 10.9. Renaming, Copying, or Comparing a Set of FilesSection 10.10. Renaming a List of Files InteractivelySection 10.11. One More Way to Do ItSection 10.12. Copying Directory Trees with cp -rSection 10.13. Copying Directory Trees with tar and PipesChapter 11. Comparing FilesSection 11.1. Checking Differences with diffSection 11.2. Comparing Three Different Versions with diff3Section 11.3. Context diffsSection 11.4. Side-by-Side diffs: sdiffSection 11.5. Choosing Sides with sdiffSection 11.6. Problems with diff and TabstopsSection 11.7. cmp and diffSection 11.8. Comparing Two Files with commSection 11.9. More Friendly comm OutputSection 11.10. make Isn't Just for Programmers!Section 11.11. Even More Uses for makeChapter 12. Showing What's in a FileSection 12.1. Cracking the NutSection 12.2. What Good Is a cat?Section 12.3. "less" is MoreSection 12.4. Show Nonprinting Characters with cat -v or od -cSection 12.5. What's in That Whitespace?Section 12.6. Finding File TypesSection 12.7. Squash Extra Blank LinesSection 12.8. How to Look at the End of a File: tailSection 12.9. Finer Control on tailSection 12.10. How to Look at Files as They GrowSection 12.11. GNU tail File FollowingSection 12.12. Printing the Top of a FileSection 12.13. Numbering LinesChapter 13. Searching Through FilesSection 13.1. Different Versions of grepSection 13.2. Searching for Text with grepSection 13.3. Finding Text That Doesn't MatchSection 13.4. Extended Searching for Text with egrepSection 13.5. grepping for a List of PatternsSection 13.6. Approximate grep: agrep

Section 13.7. Search RCS Files with rcsgrepSection 13.8. GNU Context grepsSection 13.9. A Multiline Context grep Using sedSection 13.10. Compound SearchesSection 13.11. Narrowing a Search QuicklySection 13.12. Faking Case-Insensitive SearchesSection 13.13. Finding a Character in a ColumnSection 13.14. Fast Searches and Spelling Checks with "look"Section 13.15. Finding Words Inside Binary FilesSection 13.16. A Highlighting grepChapter 14. Removing FilesSection 14.1. The Cycle of Creation and DestructionSection 14.2. How Unix Keeps Track of Files: InodesSection 14.3. rm and Its DangersSection 14.4. Tricks for Making rm SaferSection 14.5. Answer "Yes" or "No" Forever with yesSection 14.6. Remove Some, Leave SomeSection 14.7. A Faster Way to Remove Files InteractivelySection 14.8. Safer File Deletion in Some DirectoriesSection 14.9. Safe Delete: Pros and ConsSection 14.10. Deletion with Prejudice: rm -fSection 14.11. Deleting Files with Odd NamesSection 14.12. Using Wildcards to Delete Files with Strange NamesSection 14.13. Handling a Filename Starting with a Dash (-)Section 14.14. Using unlink to Remove a File with a Strange NameSection 14.15. Removing a Strange File by its i-numberSection 14.16. Problems Deleting DirectoriesSection 14.17. Deleting Stale FilesSection 14.18. Removing Every File but OneSection 14.19. Using find to Clear Out Unneeded FilesChapter 15. Optimizing Disk SpaceSection 15.1. Disk Space Is CheapSection 15.2. Instead of Removing a File, Empty ItSection 15.3. Save Space with "Bit Bucket" Log Files and MailboxesSection 15.4. Save Space with a LinkSection 15.5. Limiting File SizesSection 15.6. Compressing Files to Save SpaceSection 15.7. Save Space: tar and compress a Directory TreeSection 15.8. How Much Disk Space?Section 15.9. Compressing a Directory Tree: Fine-TuningSection 15.10. Save Space in Executable Files with stripSection 15.11. Disk QuotasPart IV: Basic EditingChapter 16. Spell Checking, Word Counting, and Textual AnalysisSection 16.1. The Unix spell CommandSection 16.2. Check Spelling Interactively with ispellSection 16.3. How Do I Spell That Word?Section 16.4. Inside spellSection 16.5. Adding Words to ispell's Dictionary

Section 16.6. Counting Lines, Words, and Characters: wcSection 16.7. Find a a Doubled WordSection 16.8. Looking for ClosureSection 16.9. Just the Words, PleaseChapter 17. vi Tips and TricksSection 17.1. The vi Editor: Why So Much Material?Section 17.2. What We CoverSection 17.3. Editing Multiple Files with viSection 17.4. Edits Between FilesSection 17.5. Local Settings for viSection 17.6. Using Buffers to Move or Copy TextSection 17.7. Get Back What You Deleted with Numbered BuffersSection 17.8. Using Search Patterns and Global CommandsSection 17.9. Confirming Substitutions in viSection 17.10. Keep Your Original File, Write to a New FileSection 17.11. Saving Part of a FileSection 17.12. Appending to an Existing FileSection 17.13. Moving Blocks of Text by PatternsSection 17.14. Useful Global Commands (with Pattern Matches)Section 17.15. Counting Occurrences; Stopping Search WrapsSection 17.16. Capitalizing Every Word on a LineSection 17.17. Per-File Setups in Separate FilesSection 17.18. Filtering Text Through a Unix CommandSection 17.19. vi File Recovery Versus Networked FilesystemsSection 17.20. Be Careful with vi -r Recovered BuffersSection 17.21. Shell Escapes: Running One UnixCommand While UsingAnotherSection 17.22. vi Compound SearchesSection 17.23. vi Word AbbreviationSection 17.24. Using vi Abbreviations as Commands (Cut and PasteBetween vi's)Section 17.25. Fixing Typos with vi AbbreviationsSection 17.26. vi Line Commands Versus Character CommandsSection 17.27. Out of Temporary Space? Use Another DirectorySection 17.28. Neatening LinesSection 17.29. Finding Your Place with UndoSection 17.30. Setting Up vi with the .exrc FileChapter 18. Creating Custom Commands in viSection 18.1. Why Type More Than You Have To?Section 18.2. Save Time and Typing with the vi map CommandsSection 18.3. What You Lose When You Use map!Section 18.4. vi @-FunctionsSection 18.5. Keymaps for Pasting into a Window Running viSection 18.6. Protecting Keys from Interpretation by exSection 18.7. Maps for Repeated EditsSection 18.8. More Examples of Mapping Keys in viSection 18.9. Repeating a vi KeymapSection 18.10. Typing in Uppercase Without CAPS LOCKSection 18.11. Text-Input Mode Cursor Motion with No Arrow KeysSection 18.12. Don't Lose Important Functions with vi Maps: UsenoremapSection 18.13. vi Macro for Splitting Long LinesSection 18.14. File-Backup Macros

Chapter 19. GNU EmacsSection 19.1. Emacs: The Other EditorSection 19.2. Emacs Features: A Laundry ListSection 19.3. Customizations and How to Avoid ThemSection 19.4. Backup and Auto-Save FilesSection 19.5. Putting Emacs in Overwrite ModeSection 19.6. Command CompletionSection 19.7. Mike's Favorite TimesaversSection 19.8. Rational SearchesSection 19.9. Unset PWD Before Using EmacsSection 19.10. Inserting Binary Characters into FilesSection 19.11. Using Word-Abbreviation ModeSection 19.12. Directories for Emacs HacksSection 19.13. An Absurd AmusementChapter 20. Batch EditingSection 20.1. Why Line Editors Aren't DinosaursSection 20.2. Writing Editing ScriptsSection 20.3. Line AddressingSection 20.4. Useful ex CommandsSection 20.5. Running Editing Scripts Within viSection 20.6. Change Many Files by Editing Just OneSection 20.7. ed/ex Batch Edits: A Typical ExampleSection 20.8. Batch Editing Gotcha: Editors Fail on Big FilesSection 20.9. patch: Generalized Updating of Files That DifferSection 20.10. Quick Reference: awkSection 20.11. Versions of awkChapter 21. You Can't Quite Call This EditingSection 21.1. And Why Not?Section 21.2. Neatening Text with fmtSection 21.3. Alternatives to fmtSection 21.4. Clean Up Program Comment BlocksSection 21.5. Remove Mail/News Headers with beheadSection 21.6. Low-Level File Butchery with ddSection 21.7. offset: Indent TextSection 21.8. Centering Lines in a FileSection 21.9. Splitting Files at Fixed Points: splitSection 21.10. Splitting Files by Context: csplitSection 21.11. Hacking on Characters with trSection 21.12. Encoding "Binary" Files into ASCIISection 21.13. Text Conversion with ddSection 21.14. Cutting Columns or FieldsSection 21.15. Making Text in Columns with prSection 21.16. Make Columns Automatically with columnSection 21.17. Straightening Jagged ColumnsSection 21.18. Pasting Things in ColumnsSection 21.19. Joining Lines with joinSection 21.20. What Is (or Isn't) Unique?Section 21.21. Rotating TextChapter 22. SortingSection 22.1. Putting Things in OrderSection 22.2. Sort Fields: How sort Sorts

Section 22.3. Changing the sort Field DelimiterSection 22.4. Confusion with Whitespace Field DelimitersSection 22.5. Alphabetic and Numeric SortingSection 22.6. Miscellaneous sort HintsSection 22.7. lensort: Sort Lines by LengthSection 22.8. Sorting a List of People by Last NamePart V: Processes and the KernelChapter 23. Job ControlSection 23.1. Job Control in a NutshellSection 23.2. Job Control BasicsSection 23.3. Using jobs EffectivelySection 23.4. Some Gotchas with Job ControlSection 23.5. The "Current Job" Isn't Always What You ExpectSection 23.6. Job Control and autowrite: Real Timesavers!Section 23.7. System Overloaded? Try Stopping Some JobsSection 23.8. Notification When Jobs Change StateSection 23.9. Stop Background Output with stty tostopSection 23.10. nohupSection 23.11. Disowning ProcessesSection 23.12. Linux Virtual ConsolesSection 23.13. Stopping Remote Login SessionsChapter 24. Starting, Stopping, and Killing ProcessesSection 24.1. What's in This ChapterSection 24.2. fork and execSection 24.3. Managing Processes: Overall ConceptsSection 24.4. SubshellsSection 24.5. The ps CommandSection 24.6. The Controlling TerminalSection 24.7. Tracking Down ProcessesSection 24.8. Why ps Prints Some Commands in ParenthesesSection 24.9. The /proc FilesystemSection 24.10. What Are Signals?Section 24.11. Killing Foreground JobsSection 24.12. Destroying Processes with killSection 24.13. Printer Queue Watcher: A Restartable Daemon ShellScriptSection 24.14. Killing All Your ProcessesSection 24.15. Killing Processes by Name?Section 24.16. Kill Processes InteractivelySection 24.17. Processes Out of Control? Just STOP ThemSection 24.18. Cleaning Up an Unkillable ProcessSection 24.19. Why You Can't Kill a ZombieSection 24.20. The Process Chain to Your WindowSection 24.21. Terminal Windows Without ShellsSection 24.22. Close a Window by Killing Its Process(es)Chapter 25. Delayed ExecutionSection 25.1. Building Software Robots the Easy WaySection 25.2. Periodic Program Execution: The cron FacilitySection 25.3. Adding crontab EntriesSection 25.4. Including Standard Input Within a cron Entry

Section 25.5. The at CommandSection 25.6. Making Your at Jobs QuietSection 25.7. Checking and Removing JobsSection 25.8. Avoiding Other at and cron JobsSection 25.9. Waiting a Little While: sleepChapter 26. System Performance and ProfilingSection 26.1. Timing Is EverythingSection 26.2. Timing ProgramsSection 26.3. What Commands Are Running and How Long Do TheyTake?Section 26.4. Checking System Load: uptimeSection 26.5. Know When to Be "nice" to Other Users.and When NotToSection 26.6. A nice GotchaSection 26.7. Changing a Running Job's NicenessPart VI: ScriptingChapter 27. Shell InterpretationSection 27.1. What the Shell DoesSection 27.2. How the Shell Executes Other CommandsSection 27.3. What's a Shell, Anyway?Section 27.4. Command Evaluation and Accidentally Overwriting FilesSection 27.5. Output Command-Line Arguments One by OneSection 27.6. Controlling Shell Command SearchesSection 27.7. Wildcards Inside AliasesSection 27.8. eval: When You Need Another ChanceSection 27.9. Which One Will bash Use?Section 27.10. Which One Will the C Shell Use?Section 27.11. Is It "2 &1 file" or " file 2 &1"? Why?Section 27.12. Bourne Shell QuotingSection 27.13. Differences Between Bourne and C Shell QuotingSection 27.14. Quoting Special Characters in FilenamesSection 27.15. Verbose and Echo Settings Show QuotingSection 27.16. Here DocumentsSection 27.17. "Special" Characters and OperatorsSection 27.18. How Many Backslashes?Chapter 28. Saving Time on the Command LineSection 28.1. What's Special About the Unix Command LineSection 28.2. Reprinting Your Command Line with CTRL-rSection 28.3. Use Wildcards to Create Files?Section 28.4. Build Strings with { }Section 28.5. String Editing (Colon) OperatorsSection 28.6. Automatic CompletionSection 28.7. Don't Match Useless Files in Filename CompletionSection 28.8. Repeating CommandsSection 28.9. Repeating and Varying CommandsSection 28.10. Repeating a Command with Copy-and-PasteSection 28.11. Repeating a Time-Varying CommandSection 28.12. Multiline Commands, Secondary PromptsSection 28.13. Here Document Example #1: Unformatted Form LettersSection 28.14. Command SubstitutionSection 28.15. Handling Lots of Text with Temporary Files

Section 28.16. Separating Commands with SemicolonsSection 28.17. Dealing with Too Many ArgumentsSection 28.18. ExpectChapter 29. Custom CommandsSection 29.1. Creating Custom CommandsSection 29.2. Introduction to Shell AliasesSection 29.3. C-Shell Aliases with Command-Line ArgumentsSection 29.4. Setting and Unsetting Bourne-Type AliasesSection 29.5. Korn-Shell AliasesSection 29.6. zsh AliasesSection 29.7. Sourceable ScriptsSection 29.8. Avoiding C-Shell Alias LoopsSection 29.9. How to Put if-then-else in a C-Shell AliasSection 29.10. Fix Quoting in csh Aliases with makealias and quoteSection 29.11. Shell Function BasicsSection 29.12. Shell Function SpecificsSection 29.13. Propagating Shell FunctionsSection 29.14. Simulated Bourne Shell Functions and AliasesChapter 30. The Use of HistorySection 30.1. The Lessons of HistorySection 30.2. History in a NutshellSection 30.3. My Favorite Is ! Section 30.4. My Favorite Is !:n*Section 30.5. My Favorite Is Section 30.6. Using ! for Safety with WildcardsSection 30.7. History by NumberSection 30.8. History SubstitutionsSection 30.9. Repeating a Cycle of CommandsSection 30.10. Running a Series of Commands on a FileSection 30.11. Check Your History First with :pSection 30.12. Picking Up Where You Left OffSection 30.13. Pass History to Another ShellSection 30.14. Shell Command-Line EditingSection 30.15. Changing History Characters with histcharsSection 30.16. Instead of Changing History CharactersChapter 31. Moving Around in a HurrySection 31.1. Getting Around the FilesystemSection 31.2. Using Relative and Absolute PathnamesSection 31.3. What Good Is a Current Directory?Section 31.4. How Does Unix Find Your Current Directory?Section 31.5. Saving Time When You Change Directories: cdpathSection 31.6. Loop Control: break and continueSection 31.7. The Shells' pushd and popd CommandsSection 31.8. Nice Aliases for pushdSection 31.9. Quick cds with AliasesSection 31.10. cd by Directory InitialsSection 31.11. Finding (Anyone's) Home Directory, QuicklySection 31.12. Marking Your Place with a Shell VariableSection 31.13. Automatic Setup When You Enter/Exit a DirectoryChapter 32. Regular Expressions (Pattern Matching)

Section 32.1. That's an ExpressionSection 32.2. Don't Confuse Regular Expressions with WildcardsSection 32.3. Understanding ExpressionsSection 32.4. Using Metacharacters in Regular ExpressionsSection 32.5. Regular Expressions: The Anchor Characters and Section 32.6. Regular Expressions: Matching a Character with aCharacter SetSection 32.7. Regular Expressions: Match Any Character with . (Dot)Section 32.8. Regular Expressions: Specifying a Range of Characterswith [.]Section 32.9. Regular Expressions: Exceptions in a Character SetSection 32.10. Regular Expressions: Repeating Character Sets with *Section 32.11. Regular Expressions: Matching a Specific Number of Setswith \ { and \ }Section 32.12. Regular Expressions: Matching Words with \ and \ Section 32.13. Regular Expressions: Remembering Patterns with \ (, \ ),and \1Section 32.14. Regular Expressions: Potential ProblemsSection 32.15. Extended Regular ExpressionsSection 32.16. Getting Regular Expressions RightSection 32.17. Just What Does a Regular Expression Match?Section 32.18. Limiting the Extent of a MatchSection 32.19. I Never Meta Character I Didn't LikeSection 32.20. Valid Metacharacters for Different Unix ProgramsSection 32.21. Pattern Matching Quick Reference with ExamplesChapter 33. WildcardsSection 33.1. File-Naming WildcardsSection 33.2. Filename Wildcards in a NutshellSection 33.3. Who Handles Wildcards?Section 33.4. What if a Wildcard Doesn't Match?Section 33.5. Maybe You Shouldn't Use Wildcards in PathnamesSection 33.6. Getting a List of Matching Files with grep -lSection 33.7. Getting a List of Nonmatching FilesSection 33.8. nom: List Files That Don't Match a WildcardChapter 34. The sed Stream EditorSection 34.1. sed Sermon H H H H H HSummarySection 34.2. Two Things You Must Know About sedSection 34.3. Invoking sedSection 34.4. Testing and Using a sed Script: checksed, runsedSection 34.5. sed Addressing BasicsSection 34.6. Order of Commands in a ScriptSection 34.7. One Thing at a TimeSection 34.8. Delimiting a Regular ExpressionSection 34.9. Newlines in a sed ReplacementSection 34.10. Referencing the Search String in a ReplacementSection 34.11. Referencing Portions of a Search StringSection 34.12. Search and Replacement: One Match Among ManySection 34.13. Transformations on TextSection 34.14. Hold Space: The Set-Aside BufferSection 34.15. Transforming Part of a LineSection 34.16. Making Edits Across Line BoundariesSection 34.17. The Deliberate ScrivenerSection 34.18. Searching for Patterns Split Across Lines

Section 34.19. Multiline DeleteSection 34.20. Making Edits Everywhere Except.Section 34.21. The sed Test CommandSection 34.22. Uses of the sed Quit CommandSection 34.23. Dangers of the sed Quit CommandSection 34.24. sed Newlines, Quoting, and Backslashes in a Shell ScriptChapter 35. Shell Programming for the UninitiatedSection 35.1. Writing a Simple Shell ProgramSection 35.2. Everyone Should Learn Some Shell ProgrammingSection 35.3. What Environment Variables Are Good ForSection 35.4. Parent-Child RelationshipsSection 35.5. Predefined Environment VariablesSection 35.6. The PATH Environment VariableSection 35.7. PATH and pathSection 35.8. The DISPLAY Environment VariableSection 35.9. Shell VariablesSection 35.10. Test String Values with Bourne-Shell caseSection 35.11. Pattern Matching in case StatementsSection 35.12. Exit Status of Unix ProcessesSection 35.13. Test Exit Status with the if StatementSection 35.14. Testing Your SuccessSection 35.15. Loops That Test Exit StatusSection 35.16. Set Exit Status of a Shell (Script)Section 35.17. Trapping Exits Caused by InterruptsSection 35.18. read: Reading from the KeyboardSection 35.19. Shell Script "Wrappers" for awk, sed, etc.Section 35.20. Handling Command-Line Arguments in Shell ScriptsSection 35.21. Handling Command-Line Arguments with a for LoopSection 35.22. Handling Arguments with while and shiftSection 35.23. Loop Control: break and continueSection 35.24. Standard Command-Line ParsingSection 35.25. The Bourne Shell set CommandSection 35.26. test: Testing Files and StringsSection 35.27. Picking a Name for a New CommandSection 35.28. Finding a Program Name and Giving Your Program MultipleNamesSection 35.29. Reading Files with the . and source CommandsSection 35.30. Using Shell Functions in Shell ScriptsChapter 36. Shell Programming for the InitiatedSection 36.1. Beyond the BasicsSection 36.2. The Story of : # #!Section 36.3. Don't Need a Shell for Your Script? Don't Use OneSection 36.4. Making #! Search the PATHSection 36.5. The exec CommandSection 36.6. The Unappreciated Bourne Shell ":" OperatorSection 36.7. Parameter SubstitutionSection 36.8. Save Disk Space and Programming: Multiple Names for aProgramSection 36.9. Finding the Last Command-Line ArgumentSection 36.10. How to Unset All Command-Line ParametersSection 36.11. Standard Input to a for LoopSection 36.12. Making a for Loop with Multiple Variables

Section 36.13. Using basename and dirnameSection 36.14. A while Loop with Several Loop Control CommandsSection 36.15. Overview: Open Files and File DescriptorsSection 36.16. n &m: Swap Standard Output and Standard ErrorSection 36.17. A Shell Can Read a Script from Its Standard Input, but.Section 36.18. Shell Scripts On-the-Fly from Standard InputSection 36.19. Quoted hereis Document Terminators: sh Versus cshSection 36.20. Turn Off echo for "Secret" AnswersSection 36.21. Quick Reference: exprSection 36.22. Testing Characters in a String with exprSection 36.23. Grabbing Parts of a StringSection 36.24. Nested Command SubstitutionSection 36.25. Testing Two Strings with One case StatementSection 36.26. Outputting Text to an X WindowSection 36.27. Shell LockfileChapter 37. Shell Script Debugging and GotchasSection 37.1. Tips for Debugging Shell ScriptsSection 37.2. Bourne Shell Debugger Shows a Shell VariableSection 37.3. Stop Syntax Errors in Numeric TestsSection 37.4. Stop Syntax Errors in String TestsSection 37.5. Quoting and Command-Line ParametersSection 37.6. How Unix Keeps TimeSection 37.7. Copy What You Do with scriptSection 37.8. Cleaning script FilesSection 37.9. Making an Arbitrary-Size File for TestingPart VII: Extending and Managing Your EnvironmentChapter 38. Backing Up FilesSection 38.1. What Is This "Backup" Thing?Section 38.2. tar in a NutshellSection 38.3. Make Your Own BackupsSection 38.4. More Ways to Back UpSection 38.5. How

Section 1.21. Unix Networking and Communications Section 1.22. The X Window System Chapter 2. Getting Help Section 2.1. The man Command Section 2.2. whatis: One-Line Command Summaries Section 2.3. whereis: Finding Where a Command Is Located Section 2.4. Searching Online Manual Pages Section 2.5. How