Learn Bash Scripting

Learn Bash Scripting

This is a free tutorial series that will teach you the basics of Bash shell scripting.

Each chapter is written in a hands-on approach. Which means you should be able to follow the examples on your Linux system. There are sample exercises to test your learning at the end of each chapter.

What will you learn?

There are nine sections in this bash scripting tutorial. You'll learn to:

  • Create and run your first bash shell script
  • Use variables
  • Pass arguments and accept user inputs in your bash scripts
  • Perform mathematical calculations
  • Manipulate strings
  • Use conditional statements like if-else
  • Use for, while and until loops
  • Create functions

Who is the target audience?

Anyone who wants to start learning bash shell scripting.

If you are a student with shell scripting as part of your course curriculum, this series is for you.

If you are a regular desktop Linux user, this series will help you understand most shell scripts you come across while exploring various software and fixes. You could also use it to automate some common, repetitive tasks.

By the end of this Bash Basics series, you should be able to write simple to moderate bash scripts.

All the chapters in the series have sample exercises so you can learn it by doing it.

You'll learn bash shell scripting here. While other shells have mostly the same syntax, their behavior still differs at a few points. Bash is the most common and universal shell, so start learning shell scripting with bash.


It is desirable that you have basic knowledge of the Linux command line and any programming language.

If you are absolutely new to the Linux command line, I advise you to get the basics right first.

19 Basic But Essential Linux Terminal Tips You Must Know
Learn some small, basic but often ignored things about the terminal. With the small tips, you should be able to use the terminal with slightly more efficiency.

You should understand how to go to a specific location in the command line. For that, you need to understand how path works in the Linux filesystem works.

Absolute vs Relative Path in Linux: What’s the Difference?
In this essential Linux learning chapter, know about the relative and absolute paths in Linux. What’s the difference between them and which one should you use.

Next, this tutorial series gives you the basic of directory navigation and file manipulation.

Getting Started With Linux Terminal
Want to know the basics of the Linux command line? Here’s a tutorial series with a hands-on approach.

Let's begin!