The Linux Command Line, 2nd Edition: A Complete Introduction
Book information
Description
You've experienced the shiny, point-and-click surface of your Linux computer—now dive below and explore its depths with the power of the command line. The Linux Command Line takes you from your very first terminal keystrokes to writing full programs in Bash, the most popular Linux shell (or command line). Along the way you'll learn the timeless skills handed down by generations of experienced, mouse-shunning gurus: file navigation, environment configuration, command chaining, pattern matching with regular expressions, and more. In addition to that practical knowledge, author William Shotts reveals the philosophy behind these tools and the rich heritage that your desktop Linux machine has inherited from Unix supercomputers of yore. As you make your way through the book's short, easily-digestible chapters, you'll learn how to: • Create and delete files, directories, and symlinks • Administer your system, including networking, package installation, and process management • Use standard input and output, redirection, and pipelines • Edit files with Vi, the world's most popular text editor • Write shell scripts to automate common or boring tasks • Slice and dice text files with cut, paste, grep, patch, and sed Once you overcome your initial "shell shock," you'll find that the command line is a natural and expressive way to communicate with your computer. Just don't be surprised if your mouse starts to gather dust. Title Copyright About the Author About the Technical Reviewer Brief Contents Contents in Detail Acknowledgments First Edition Second Edition Introduction Why Use the Command Line? What This Book Is About Who Should Read This Book What’s in This Book How to Read This Book What’s New in the Second Edition Your Feedback Is Needed! Part I: Learning the Shell 1. What Is the Shell? Terminal Emulators Making Your First Keystrokes Try Some Simple Commands Ending a Terminal Session Summing Up 2. Navigation Understanding the File System Tree The Current Working Directory Listing the Contents of a Directory Changing the Current Working Directory Summing Up 3. Exploring the System More Fun with ls Determining a File’s Type with file Viewing File Contents with less Taking a Guided Tour Symbolic Links Hard Links Summing Up 4. Manipulating Files and Directories Wildcards mkdir—Create Directories cp—Copy Files and Directories mv—Move and Rename Files rm—Remove Files and Directories ln—Create Links Building a Playground Summing Up 5. Working With Commands What Exactly Are Commands? Identifying Commands Getting a Command’s Documentation Creating Our Own Commands with alias Summing Up 6. Redirection Standard Input, Output, and Error Redirecting Standard Output Redirecting Standard Error Redirecting Standard Input Pipelines Summing Up 7. Seeing the World as the Shell Sees It Expansion Quoting Summing Up 8. Advanced Keyboard Tricks Command Line Editing Completion Using History Summing Up 9. Permissions Owners, Group Members, and Everybody Else Reading, Writing, and Executing Changing Identities Exercising Our Privileges Changing Your Password Summing Up 10. Processes How a Process Works Viewing Processes Controlling Processes Signals Shutting Down the System More Process-Related Commands Summing Up Part II: Configuration and the Environment 11. The Environment What Is Stored in the Environment? How Is the Environment Established? Modifying the Environment Summing Up 12. A Gentle Introduction to vi Why We Should Learn vi A Little Background Starting and Stopping vi Editing Modes Moving the Cursor Around Basic Editing Search-and-Replace Editing Multiple Files Saving Our Work Summing Up 13. Customizing the Prompt Anatomy of a Prompt Trying Some Alternative Prompt Designs Adding Color Moving the Cursor Saving the Prompt Summing Up Part III: Common Tasks and Essential Tools 14. Package Management Packaging Systems How a Package System Works Common Package Management Tasks Summing Up 15. Storage Media Mounting and Unmounting Storage Devices Creating New File Systems Testing and Repairing File Systems Moving Data Directly to and from Devices Writing CD-ROM Images Summing Up Extra Credit 16. Networking Examining and Monitoring a Network Transporting Files over a Network Secure Communication with Remote Hosts Summing Up 17. Searching for Files locate—Find Files the Easy Way find—Find Files the Hard Way Summing Up 18. Archiving and Backup Compressing Files Archiving Files Synchronizing Files and Directories Summing Up 19. Regular Expressions What Are Regular Expressions? grep Metacharacters and Literals The Any Character Anchors Bracket Expressions and Character Classes POSIX Character Classes POSIX Basic vs. Extended Regular Expressions Alternation Quantifiers Putting Regular Expressions to Work Summing Up 20. Text Processing Applications of Text Revisiting Some Old Friends Slicing and Dicing Comparing Text Editing on the Fly Summing Up Extra Credit 21. Formatting Output Simple Formatting Tools Document Formatting Systems Summing Up 22. Printing A Brief History of Printing Printing with Linux Preparing Files for Printing Sending a Print Job to a Printer Monitoring and Controlling Print Jobs Summing Up 23. Compiling Programs What Is Compiling? Compiling a C Program Summing Up Part IV: Writing Shell Scripts 24. Writing Your First Script What Are Shell Scripts? How to Write a Shell Script More Formatting Tricks Summing Up 25. Starting a Project First Stage: Minimal Document Second Stage: Adding a Little Data Variables and Constants Here Documents Summing Up 26. Top-Down Design Shell Functions Local Variables Keep Scripts Running Summing Up 27. Flow Control: Branching with if if Statements Exit Status Using test A More Modern Version of test (( ))—Designed for Integers Combining Expressions Control Operators: Another Way to Branch Summing Up 28. Reading Keyboard Input read—Read Values from Standard Input Validating Input Menus Summing Up Extra Credit 29. Flow Control: Looping with while/until Looping Breaking Out of a Loop Reading Files with Loops Summing Up 30. Troubleshooting Syntactic Errors Logical Errors Testing Debugging Summing Up 31. Flow Control: Branching with case The case Command Summing Up 32. Positional Parameters Accessing the Command Line Handling Positional Parameters en Masse A More Complete Application Summing Up 33. Flow Control: Looping with for for: Traditional Shell Form for: C Language Form Summing Up 34. Strings and Numbers Parameter Expansion Arithmetic Evaluation and Expansion bc—An Arbitrary Precision Calculator Language Summing Up Extra Credit 35. Arrays What Are Arrays? Creating an Array Assigning Values to an Array Accessing Array Elements Array Operations Associative Arrays Summing Up 36. Exotica Group Commands and Subshells Traps Asynchronous Execution with wait Named Pipes Summing Up Index
Similar books
The Linux Command Line: A Complete Introduction, 2nd Edition
2019 · AZW
The Linux Command Line
2019 · EPUB
The Linux Command Line, 2nd Edition: A Complete Introduction
2019 · MOBI
The Linux Command Line
Adventures with the Linux Command Line - First Internet Edition
2021 · PDF
The Linux Command Line
2019 · PDF
The Linux Command Line: A Complete Introduction
2019 · PDF
The Linux Command Line
2019 · PDF