learn bash

Bashing your Way — Learn Bash Skills – 1

As with art, learning the foundations of skills can improve the productive over time. No matter what programming language like PHP, Node or Python you know, the very basic skill with Linux is shell programming. Shell programming is an essential skill many lacks. Here we learn bash skills.

Part 1 – Basic Bash

Bash – is the standard shell on Linux, also a superset of the Bourne shell such that, commands that work in sh, will work in bash also.

In Part 1, we learn some basic stuff to get started for anyone.

The Shebang!

All file to be written in bash starts with shebang which is #!/bin/bash. Below explains a simple file

Creating a File & Folder

Setting Permission

chmod – change file mode bits. The + operator used to add file mode bits and – to remove the file mode.

The combination of letters controls the user access

u is for a user,
g is for group,
and o is for others.

r is for reading permission,
w is for write permission,
x is for execute permission.


Note there shouldn’t be any space between = or bash will throw error which only wizards can understand 😛 and semicolon is not required at the end

Mathematical Operations

Mathematical operations are done using the $[]


Conditional & Comparison Statements

Following is the simple skeleton for if statement.

and else statement




File operation

Reading From Users

Reading from bash is very simple using read


This takes care of part 1 of learning bash skills. In Part 2 we will make a big jump to advanced stuffs like sed, functions, signals & jobs.