The Linux Command Line, 2nd Edition: A Complete Introduction

Front Cover
No Starch Press, Mar 7, 2019 - Computers - 504 pages
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.
     

    Contents

    Try Some Simple Commands
    5
    Navigation
    7
    Summing Up
    12
    Manipulating Files and Directories
    23
    In Create Links
    30
    Summing Up
    37
    Working with Commands
    39
    Creating Our Own Commands with alias
    46
    Text Processing
    245
    Slicing and Dicing
    256
    Comparing Text
    262
    Summing Up
    278
    Formatting Output
    279
    Document Formatting Systems
    290
    Printing
    297
    Compiling Programs
    309

    Redirecting Standard Error
    52
    Read from Stdin and Output to Stdout and Files
    59
    Seeing the World as the Shell Sees It
    61
    Quoting
    67
    8
    73
    Summing
    80
    Permissions
    81
    Changing Identities
    91
    Changing Your Password
    97
    Processes
    99
    Controlling Processes
    104
    Shutting Down the System
    110
    The Environment
    115
    What Is Stored in the Environment?
    116
    12
    127
    Editing Multiple Files
    139
    Customizing the Prompt
    145
    Saving the Prompt
    151
    Storage Media
    165
    Networking
    181
    Summing Up
    193
    Searching for Files
    195
    Archiving and Backup
    209
    Synchronizing Files and Directories
    219
    Regular Expressions
    225
    POSIX Character Classes
    231
    Putting Regular Expressions to Work
    239
    Summing Up
    319
    WRITING SHELL SCRIPTS
    321
    Writing Your First Script
    323
    More Formatting Tricks
    327
    Starting a Project
    329
    Here Documents
    336
    TopDown Design
    339
    Flow Control Branching with if
    349
    Using test
    352
    Reading Keyboard Input
    363
    Validating Input
    370
    Flow Control Looping with whileuntil
    375
    Troubleshooting
    383
    Logical Errors
    387
    Flow Control Branching with case
    395
    Positional Parameters
    401
    A More Complete Application
    407
    Flow Control Looping with for
    413
    Strings and Numbers
    419
    Arithmetic Evaluation and Expansion
    427
    bcAn Arbitrary Precision Calculator Language
    434
    Arrays
    437
    Array Operations
    441
    Exotica
    447
    Traps
    453
    Index
    459
    Copyright

    Other editions - View all

    Common terms and phrases

    About the author (2019)

    William Shotts has been a software professional for more than 30 years and an avid Linux user for more than 20 years. He has an extensive background in software development, including technical support, quality assurance, and documentation. He is also the creator of LinuxCommand.org, a Linux education and advocacy site featuring news, reviews, and extensive support for using the Linux command line.

    Bibliographic information