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.

cdupdated Sep 202025 examples

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.

export PS0=">>updated Sep 20204 examples

The Complete How To Guide of Bash Functions

Learn how to write shell scripts with bash functions. This guide includes examples and best practices on how to define, call, and debug functions in bash.

fn() {updated Sep 202017 examples

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.

for nameupdated Sep 202014 examples

How To Script Error Free Bash If Statement?

Learn how to script a Bash If statement with the then, else, and else if / elif clauses. Includes Bash conditional expressions and common pitfalls to avoid.

ifupdated Sep 202024 examples

What is the Bash Null Command?

Learn about the Bash null command, also known as the POSIX shell colon command. This post cover concrete use cases and pitfalls to avoid.

set -oupdated Sep 202012 examples

What's New in Focal Fossa Ubuntu 20.04 LTS?

Ubuntu 20.04 LTS is available for download. Find out some of the major security and performance improvements from this new distribution, including the introduction of WireGuard VPN, upgraded suite of software packages, faster boot time, etc.

lsb_release -aupdated Sep 20206 examples

Mastering Linux with Tips and Tricks

Collection of Blog posts for Mastering Linux. This section covers the basics of manipulating and formatting dates with GNU Date or in Bash, tuning sysctl, common sudo and tty errors, Ubuntu tips and news, and more.

updated Sep 2020

Must Have Cheat Sheets

Collection of cheatsheets with all the essentials you need from Bash to Vi/Vim and Linux.

updated Sep 2020

How and When to Use the Dot Command in Bash?

Learn the difference between the dot command (.) and a dot file notation. This post cover how and when you should leverage the dot command to execute a Bash script.

.: .updated Sep 20204 examples

What's New in GNU Bash 5?

Bash version 5 is generally available and comes with some important improvements and new features like BASH_ARGV0, EPOCHSECONDS, and EPOCHREALTIME.

date '+%s'updated Sep 20201 example

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.

echo "a=1;updated Sep 20208 examples

Redirecting a stdout to a file using sudo and tee

Learn how to address a permission denied error when trying to edit a file on Linux and work around some sudo issues. This post include a simple vim tips to save changes to a file with sudo right from your editor.

touchupdated Sep 20205 examples

sudo: sorry, you must have a tty to run sudo

Learn what is a tty and how to solve 'sudo: sorry, you must have a tty to run sudo' error when using ssh to execute a sudo remote command.

Defaults:myuserupdated Sep 20202 examples

How to Reload or Change your current Shell?

Learn the basic steps to reload your Linux shell to apply your recent configurations changes. This post cover the POSIX exec builtin command in Bash and the GNOME shell.

help execupdated Sep 20205 examples

Removing ^M in imported Windows files

Learn how to quickly and easily handle files with newline and carriage return between linux, mac, and windows. This post will explain how to remove or replace the often annoying ^M character.

alias cvtCR="trupdated Sep 20202 examples

How To Find Quickly A Bash Command Type?

Learn how to find out the type of a shell command and the definition of an alias or function by using the type or command Bash builtins.

type: usage:updated Sep 20206 examples