Book Image

Linux Command Line and Shell Scripting Bible - Third Edition

By : Richard Blum, Christine Bresnahan
Book Image

Linux Command Line and Shell Scripting Bible - Third Edition

By: Richard Blum, Christine Bresnahan

Overview of this book

The Linux command line enables you to type specific shell commands directly into the system to manipulate files and query system resources. Command line statements can be combined into short programs called shell scripts, a practice increasing in popularity due to its usefulness in automation. Linux is a robust system with tremendous potential, and Linux Command Line and Shell Scripting Bible opens the door to new possibilities. Linux Command Line and Shell Scripting Bible is your essential Linux guide. It contains new functional examples that are fully updated to align with the latest Linux features. Beginning with command line fundamentals, the book moves into shell scripting and shows you the practical application of commands in automating frequently performed functions. This book is a complete guide providing detailed instruction and expert advice working within this aspect of Linux. Whether used as a tutorial or as a quick reference, this book contains information that every Linux user should know.
Table of Contents (34 chapters)
Part I: The Linux Command Line
Part II: Shell Scripting Basics
Part III: Advanced Shell Scripting
Part IV: Creating Practical Scripts
End User License Agreement

How This Book Is Organized

This book leads you through the basics of the Linux command line and into more complicated topics, such as creating your own shell scripts. The book is divided into four parts, each one building on the previous parts.

Part I assumes that you either have a Linux system running or are looking into getting a Linux system. Chapter 1, “Starting with Linux Shells,” describes the parts of a total Linux system and shows how the shell fits in. After describing the basics of the Linux system, this part continues with the following:

  • Using a terminal emulation package to access the shell (Chapter 2)
  • Introducing the basic shell commands (Chapter 3)
  • Using more advanced shell commands to peek at system information (Chapter 4)
  • Understanding what the shell is used for (Chapter 5)
  • Working with shell variables to manipulate data (Chapter 6)
  • Understanding the Linux filesystem and security (Chapter 7)
  • Working with Linux filesystems from the command line (Chapter 8)
  • Installing and updating software from the command line (Chapter 9)
  • Using the Linux editors to start writing shell scripts (Chapter 10)

In Part II, you begin writing shell scripts. As you go through the chapters, you'll do the following:

  • Learn how to create and run shell scripts (Chapter 11)
  • Alter the program flow in a shell script (Chapter 12)
  • Iterate through code sections (Chapter 13)
  • Handle data from the user in your scripts (Chapter 14)
  • See different methods for storing and displaying data from your Script (Chapter 15)
  • Control how and when your shell scripts run on the system (Chapter 16)

Part III dives into more advanced areas of shell script programming, including these things:

  • Creating your own functions to use in all your scripts (Chapter 17)
  • Utilizing the Linux graphical desktop for interacting with your script users (Chapter 18)
  • Using advanced Linux commands to filter and parse data files (Chapter 19)
  • Using regular expressions to define data (Chapter 20)
  • Learning advanced methods of manipulating data in your scripts (Chapter 21)
  • Generating reports from raw data (Chapter 22)
  • Modifying your shell scripts to run in other Linux shells (Chapter 23)

The last section of the book, Part IV, demonstrates how to use shell scripts in real-world environments. In this part, you will learn these things:

  • How to put all the scripting features together to write your own scripts (Chapter 24)
  • How to store and retrieve data using databases, access data on the Internet, and send e-mail messages (Chapter 25)
  • Write more advanced shell scripts to interact on your Linux system (Chapter 26)

Cautions, Tips, and Notes

You will find many different organizational and typographical features throughout this book designed to help you get the most of the information.

Downloadable code

You can obtain the book's code files at