Skip to main content

Bash Tips

Here is a collection of bash shell scripts that will not only help you learn shell scripting but also improve your existing bash shell knowledge.

A collection of 40 posts

Convert strings to integers in bash
Bash Tips

How to Evaluate Strings as Numbers in Bash

Learn how to evaluate bash strings as integers to perform successful arithmetic operations.

· Avimanyu Bandyopadhyay

Simple yet useful bash history tips for Linux users
Bash Tips

5 Simple Bash History Tricks Every Linux User Should Know

Effectively using bash history will save you plenty of time in the Linux terminal.

· Abhishek Prakash

Bash case statement featured
Bash Tips

Using Case Statements in Bash

Instead of a bunch of nested if else statements, using case statements can drastically reduce the number of lines in your bash script, making it easier to understand and follow the logic.

· Hunter Wittenborn

What is Subshell in Linux?
Explain

What is Subshell in Linux?

You might have heard that a shell script runs in its own shell. Learn more on the concept of subshell in Linux.

· Abhishek Prakash

Using Bash printf Command for Printing Formatted Outputs
Bash Tips

Using Bash printf Command for Printing Formatted Outputs

You may print simple outputs with echo command but that's not enough for complicated formatted outputs.

· Abhishek Prakash

Process Substitution: An Uncommon but Advanced Way for Input/Output Redirection in Linux
Bash Tips

Process Substitution: An Uncommon but Advanced Way for Input/Output Redirection in Linux

Multiple commands and input/output redirections can be effectively used with bash process substitution.

· Abhishek Prakash

Comments in bash shell script
Bash Tips

Writing Comments in Bash Scripts: Single Line, Inline and Multi-line Comments

Wondering about comments in bash script? Here's how to add single, inline or multiline comments in Bash scripts.

· Abhishek Prakash

Check if file exists in bash
Bash Tips

How to Check if File or Directory Exists in Bash Shell

Here are several ways you can check if file or directory exists in bash shell script. You'll also learn to check if file doesn't exist.

· Abhishek Prakash

Bash shell
Bash Tips

How to Split String in Bash Script

In this quick tip, you'll learn to split a string into an array in Bash script.

· Abhishek Prakash

bash
Bash Tips

How to Compare Strings in Bash Shell Scripting

In this tutorial you'll learn how to compare strings in bash shell scripts.You'll also learn to check if a string is empty or null.

· Abhishek Prakash