Book Image

Command Line Fundamentals

By : Vivek Nagarajan
Book Image

Command Line Fundamentals

By: Vivek Nagarajan

Overview of this book

The most basic interface to a computer—the command line—remains the most flexible and powerful way of processing data and performing and automating various day-to-day tasks. Command Line Fundamentals begins by exploring the basics, and then focuses on the most common tool, the Bash shell (which is standard on all Linux and iOS systems). As you make your way through the book, you'll explore the traditional Unix command-line programs as implemented by the GNU project. You'll also learn to use redirection and pipelines to assemble these programs to solve complex problems. By the end of this book, you'll have explored the basics of shell scripting, allowing you to easily and quickly automate tasks.
Table of Contents (6 chapters)

Introduction

In the previous chapters, we learned most of the shell constructs and syntax that are used with the interactive command line. We also built a vocabulary of useful commands and learned how to combine them. In this final chapter, we will learn a few more shell constructs and commands, all of which when combined, will let us use the shell as a generic programming language.

The programs we write for the shell's language are called shell scripts. Any task we perform once can be converted into a shell script that can be repeated later. Scripts can be executed just like any other program in the system, giving us a way to automate our workflows. Since the shell can use any program that's installed on the system, by installing the right command-line utilities, we can automate practically anything we do manually.

Once we have learned this, for the remainder of the chapter, we will create several complex shell scripts that perform a non-trivial task, to cement our...