Available tutorials in bash

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 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 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 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 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 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 character of a string in Bash

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

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 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 first element of an array in Bash

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

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…

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 remove the first element from an array in Bash

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

Getting the length of a string in a Bash

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

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 a .bashrc in Terminal

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

How to reload your .zshrc file in Terminal

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

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 get the length of an array in Bash

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

How to replace the character in a string with Bash

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

How to print a new line in bash

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

How to split a string in bash by delimiter

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

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 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…

What is 2>&1 mean in Linux shell

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

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 trim whitespace of a string in Bash

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

How to compare two strings in Bash

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

How to convert a string into a lowercase in Bash

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

How to change output color of echo in Linux

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

How to extract filename and extension separately in bash

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

How to concatenate variables in Bash

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

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 check if the file does not exist in Bash

To check, if a file doesn’t exist in the bash we need to use not…

How to parse command line arguments in Bash

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

For loop in Bash script

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

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 run multiple commands in Python

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

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…