Linux Shell Scripting Tutorial (LSST) v1.05r3
Chapter 1: Introduction: Quick Introduction to Linux


This tutorial is designed for beginners who wish to learn the basics of shell scripting/programming plus introduction to power tools such as awk, sed, etc. It is not help or manual for the shell; while reading this tutorial you can find manual quite useful (type man bash at $ prompt to see manual pages). Manual contains all necessary information you need, but it won't have that much examples, which makes idea more clear. For this reason, this tutorial contains examples rather than all the features of shell.

Audience for this tutorial

I assumes you have at least working knowledge of Linux i.e. basic commands like how to create, copy, remove files/directories etc or how to use editor like vi or mcedit and login to your system. But not expects any programming language experience. If you have access to Linux, this tutorial will provide you an easy-to-follow introduction to shell scripting.

What's different about this tutorial

Many other tutorial and books on Linux shell scripting are either too basic, or skips important intermediate steps. But this tutorial, maintained the balance between these two. It covers the many real life modern example of shell scripting which are almost missed by many other tutorials/documents/books. I have used a hands-on approach in this tutorial. The idea is very clear "do it yourself or learn by doing" i.e. trying things yourself is the best way to learn, so examples are presented as complete working shell scripts, which can be typed in and executed

Chapter Organization

Chapter 1 to 4 shows most of the useful and important shell scripting concepts. Chapter 5 introduction to tools & utilities which can be used while programming the Linux shell smartly. Chapter 6 and 7 is all about expression and expression mostly used by tools such as sed and awk. Chapter 8 is loaded with tons of shell scripting examples divided into different categories. Chapter 9 gives more resources information which can be used while learning the shell scripting like information on Linux file system, common Linux command reference and other resources.

Chapter 1 introduces to basic concepts such as what is Linux, where Linux can used and continue enplaning the shell, shell script and kernel etc.

Chapter 2 shows how to write the shell script and execute them. It explains many basic concepts which requires to write shell script.

Chapter 3 is all about making decision in shell scripting as well as loops in shell. It explains what expression are, how shell understands the condition/decisions. It also shows you nesting concept for if and for loop statement and debugging of shell script.

Chapter 4 introduces the many advanced shell scripting concepts such as function, user interface, File Descriptors, signal handling, Multiple command line arguments etc.

Chapter 5 introduces to powerful utility programs which can be used variety of purpose while programming the shell scripting.

Chapter 6 and 7 gives more information on patterns, filters, expressions, and off course sed and awk is covered in depth.

Chapter 8 contains lot of example of shell scripting divided into various category such as logic development, system administration etc.

Note that indicate Bulp advanced shell scripting concepts, you can skip this if are really new to Linux or Programming, though this is not RECOMMENDED by me.

Also not that currently this tutorial is also translated into some other foreign language(s); if you are interested to read it in other language the the English then please visit

I hope you get as much pleasure reading this tutorial, as I had writing it. After reading this tutorial if you are able to write your own powerful shell scripts, then I think the purpose of writing this tutorial is served and finally if you do get time after reading this tutorial drop me an e-mail message about your comment/suggestion and off course bugs (errors) of this tutorial.

What Linux is?