Available tutorials in bash

For loop in Bash script

for loop is used to iterate over a list of items until a particular…

How to change output color of echo in Linux

Learn, how to change the output color of echo text in linux command…

How to count all lines of code in a directory Bash

The following command is used to count the number of lines of code in…

How to parse command line arguments in Bash

This example will help you to parse a command line arguments in bash…

How to print a new line in bash

To print a new line in bash, we need to use literal in command…

How to check if a string starts with another in Bash

In this tutorial, we are going to learn about how to check if a string…

How to write comments in Bash

In this tutorial, we are going to learn about how to write the…

What is 2>&1 mean in Linux shell

In this tutorial, we are going to learn about what is meaning of in…

How to Get the source directory of a Bash script within the script itself

This example will help you to get the full path of an directory using…

How to check the first character of a string in Bash

In this tutorial, we are going to learn about how to check the first…

How to lowercase first letter of a string in Bash

In this tutorial, we will learn how to lowercase the first letter of a…

How to run multiple commands in Python

This example will show you, how to run a multiple bash commands with…

Compare two string variables using if statement in Bash

In this tutorial, we are going to learn about how to compare two…

How to replace a line in a text file by line number-Sed

To replace a line in a text file by using line number we can use the…

How to add the new element to an array (without index) in Bash

To add the new element to an array without specifying its index, we…

How to check if a string ends with another in Bash

In this tutorial, we are going to learn about how to check if a string…

How to Check if the program exists from a Bash script

You can use the posix compatible command to check, if the command…

How to get the last n characters of a string in Bash

In this tutorial, we are going to learn about how to get the last n…

How to check if a array is empty in Bash

In this tutorial, we are going to learn about how to check if a array…

How to convert a string into a lowercase in Bash

We can use POSIX standard command to convert a string into a…

How to concatenate variables in Bash

To concatenate a string to the existing string, we can use the…

How to remove the first character of a string in Bash

In this tutorial, we are going to learn about how to remove the first…

How to get the length of a string in Bash

Learn, how to find out the length of a string in Bash. The length of a…

How to concatenate two strings in Bash

In this tutorial, we are going to learn about how to concatenate two…

How to get the last element from an array in Bash

In this tutorial, we are going to learn about how to get the last…

How to check if the file does not exist in Bash

In this tutorial, we are going to learn about how to check if a given…

How to lowercase all letters of a string in Bash

In this tutorial, we will learn how to lowercase all letters of a…

How to remove the last character of a string in Bash

In this tutorial, we are going to learn about how to remove the last…

How to get the length of an array in Bash

In this tutorial, we are going to learn about how to find the length…

How to split a string in bash by delimiter

We can do this by setting an internal file separator (IFS) variable to…

How to remove the first n characters of a string in Bash

In this tutorial, we are going to learn about how to remove the first…

How to compare two strings in Bash

To compare a two string in bash, we can use the statement with…

Removing the first and last character of a string in Bash

In this tutorial, we are going to learn about how to remove the first…

How to get the first element of an array in Bash

In this tutorial, we are going to learn about how to get the first…

How to set a variable to the output of a command in Bash

We need to use double quotes to set a variable as an output to the…

How to remove the first element from an array in Bash

In this tutorial, we are going to learn about how to remove the first…

How to uppercase all letters of a string in Bash

In this tutorial, we will learn how to uppercase all letters of a…

How to check if a string contains a substring in Bash

This below example will show you, how to check if a string contains a…

How to extract filename and extension separately in bash

This example will show you how to extract filename and extension…

How to uppercase first letter of a string in Bash

In this tutorial, we will learn how to UPPERCASE the first letter of a…

How to reload a .bashrc in Terminal

In this tutorial, we are going to learn about how to reload a file…

How to reload a .bash_profile from the Terminal

In this tutorial, we are going to learn about how to reload a from…

How to reload your .zshrc file in Terminal

Learn, how to reload your file after making the changes to it…

How to replace the character in a string with Bash

To replace one character in a string with another character, we can…

How to trim whitespace of a string in Bash

We can remove the leading and trailing whitespaces of a string by…

How to get the last character of a string in Bash

In this tutorial, we are going to learn about how to get the last…

How to get the first n characters of a string in Bash

In this tutorial, we are going to learn about how to get the first n…

How to remove the last n characters of a string in Bash

In this tutorial, we are going to learn about how to remove the last n…

How to get the first character of a string in Bash

In this tutorial, we are going to learn about how to get the first…

How to print array elements on a separate line in Bash

In this tutorial, we will learn how to print the array elements on a…

How to remove the last element from an array in Bash

In this tutorial, we are going to learn about how to remove the last…