Mastering Bash with Tips and Tricks

Last Updated: 

GNU Bash is the GNU command-line interface shell project with a complete implementation of the IEEE POSIX specification. It is one of the most used command line shell. It comes as the default shell with most Linux distributions, is available on Mac and Windows 10. The version 5 brought a lot of improvement that makes this shell even more powerful, see What's New In GNU Bash 5?

Recommended Reading
How to Parse a CSV File in Bash?
Learn how to parse a CSV file in Bash and avoid the common pitfalls. Includes examples using bash builtins and the awk command line.
5 Mistakes To Avoid For Writing High-Quality Bash Comments
Adding comments in your Bash scripts is necessary to ensure maintainability over time. This post covers 5 Bash comments mistakes to avoid in your shell scripts.
How to do Math in Bash
Math Arithmetic: How To Do Calculation in Bash?
Learn how to do math arithmetic with integer and floating-point in Bash. Includes addition, subtraction, division, multiplication, and also floating-point precision.
How To Do Advanced Math Calculation Using bc?
Learn how to use the GNU Linux bc command line to do math arithmetic and algebra with square root, sine, cosine, tangent, arctangent, bessel, and more.
Bash Guides & Tutorials
A Complete Guide on How To Use Bash Arrays
This guide covers how to use the bash array variables as indexed or associative bash arrays. Includes how to declare, iterate over, sort, and other array operations.
What is the Right Way to do Bash Loops?
Looping over a list of numbers or words is a building block in shell scripts. Learn how to write Bash loops, including for loop, while loop, and until loop.
Related bash posts that you may like...
5 Simple Steps On How To Debug a Bash Shell Script
Learn how to quickly debug scripts in Bash with those 5 simple steps that use some of the Bash shell special properties.
A Complete Guide to the Bash Environment Variables
A complete guide on the Linux Bash environment variables with details on how to set, unset, and use the specials shell variables or define custom environment variables.
How To Make A Custom Bash Shell Prompt
Learn how to customize your shell prompt and the specificity of the Bash Prompt variables PROMPT_COMMAND, PROMPT_DIRTRIM, PS0, PS1, PS2, PS3, and PS4.
The Most Useful Bash Shortcuts That You Will Want To Use
A detailed review of the most useful Terminal and Bash shortcuts to improve your productivity when typing command-lines and how to customize the ones you don't like.