Cancel

Cheatsheets for Bash Scripting

If you are looking for cheat sheets for bash scripting, then this section is for you. The escape or special characters are used in the format string. Here is a list of the most common escape or sp...

Bash Scripting Complete Course

Learn bash or shell programming for Linux, Unix, and Mac. If you want to learn how to write bash scripts like a pro, solve real-world problems, or automate repetitive and complex tasks, then this ...

Write Your Own Command in Bash

Maybe you are thinking that how you can create your own bash command same as ls, echo, touch, rm, and etc. Create a bin folder in the user’s home directory. mkdir ~/bin Sync hello.sh file with ...

Wildcards in Bash

Wildcards are used in search terms, to represent one or more characters. In wildcards, we do have 3 operators, asterisk, question mark, and square brackets. The * asterisk can represent any number...

Variables in Bash

In many programming languages, we use to create a variable, which must start with either letter, or underscore, but you cannot start a variable with numbers, or any special characters. Create a va...

Subshell/Grouping in Bash

A Subshell/Grouping can be used to do parallel processing. When you run a script, it creates a new process called Subshell, and your script will get executed using a Subshell. First execute everyt...

String Slicing & Substitution in Bash

String Slicing & Substitution is the most commonly used method in any programming language, which split the values from either string or an array. In this section, I will cover only string slic...

Shebang Line in Bash

#! shebang or shebang line is used to tell the operating system which interpreter to use to parse the rest of the file. Lets create your first hello world script. #!/bin/bash echo "Hello World" ...

Non-Positional/Positional arguments in Bash

Positional arguments are parameters that we can supply to our bash script while executing. # don't forget to set execute permission. cat <<EOF > my_script.sh echo "Hi, \$1 \$2" EOF # fir...

Loops in Bash

Loops are one of the fundamental concepts of programming languages. Loops are handy when you want to run a series of commands over and over again until a certain condition is reached. I am not gon...