BASH is the GNU Project‘s shell that stands for the Bourne Again Shell. It is one of the most commonly used shells on the Linux and BSD systems. It is conform to the IEEE POSIX P1003.2/ISO 9945.2 standard. At the time of writing this article the current version of BASH is bash-5.2.

A shell is a command line interpreter on the system that receives and runs commands.
BASH is one of the most widely used interactive login shells on Linux.
If it is not present on our system, it is more than sure that it can be installed with the Linux package manager.
We can check our current shell with echoing the $SHELL environment variable. It is case sensitive with all capitals.
tmolnar@LaptopDebtop:~$ echo $SHELL
/bin/bash
Wait a minute! What is interactive? What is login shell? The topic is very deep, but in a “nut shell“:
Interactive shell
An interactive shell will accept and run user commands.
Non-interactive shell
A non-interactive shell spawns when a script is running in a sub-shell. It does not accept any interaction from the user.
Login shell
A login shell is the shell that spawns when a user logs in the system.
The shopt command prints out the options of our current shell.
tmolnar@LaptopDebtop:~$ shopt -p
shopt -s autocd
shopt -u assoc_expand_once
shopt -u cdable_vars
shopt -s cdspell
shopt -u checkhash
shopt -u checkjobs
shopt -s checkwinsize
shopt -s cmdhist
shopt -u compat31
shopt -u compat32
(...)
The above command output is just a snippet of our shell options. We can query directly the type of our shell with the following command:
tmolnar@LaptopDebtop:~$ shopt login_shell
login_shell on
The example shows that our shell is a login shell.
BASH
We will explore BASH as an interactive login shell.
We can check our default login shell with the getent command:
tmolnar@LaptopDebtop:~$ getent passwd tmolnar
tmolnar:x:1010:1010:,,,:/home/tmolnar:/bin/bash
The above command queries the /etc/passwd user database on Linux and looks up the tmolnar user. The data after the last colon shows that our default login shell is /bin/bash.
Our BASH shell is an interpreter and a scripting language as well. It means that we can write commands directly into the command prompt, or we can create small programs called scripts in files and run them from our command prompt.
Builtins and commands (utilities)
BASH provides a small set of built-in commands as well, called builtins. These are programs that are shipped by the shell itself. Some of the builtins have an utility (command) counterpart as well.
An example is the echo built-in. By default BASH will run the builtin version.
tmolnar@LaptopDebtop:~$ command -V echo
echo is a shell builtin
Echo has a command version as well:
tmolnar@LaptopDebtop:~$ ls /bin/echo
/bin/echo
If we want to run the command version, we have to use the full path of the command (/bin/echo) or we can explicitly enable the command version for our BASH shell:
tmolnar@LaptopDebtop:~$ enable -n echo
tmolnar@LaptopDebtop:~$ command -V echo
echo is /bin/echo
We can reenable the builtin with the following command:
tmolnar@LaptopDebtop:~$ enable echo
tmolnar@LaptopDebtop:~$ command -V echo
echo is a shell builtin
More information can be queried from a builtin by the help command:
tmolnar@LaptopDebtop:~$ help echo
echo: echo [-neE] [arg ...]
(...)
Commands usually have manual pages. They can be read by the man command.
tmolnar@LaptopDebtop:~$ man echo
Now we have enough knowledge to start working in BASH!
If you have anything to share then please visit my Tom’s IT Cafe Discord Server!