Ubuntu Tutorials - Herong's Tutorial Examples - v1.25, by Herong Yang
What Is Bash (Bourne Again SHell)
This section provides a quick introduction of Bash shell created by Brian Fox in 1989.
What Is Bash? - Bash (Bourne Again SHell) is an interactive command interpreter and programming language created by Brian Fox in 1989. Bash is a reimplementation and an extension of the Bourne shell for Unix/Linux-like operating systems. Bash also incorporates some useful features from the Korn and C shells.
Main features of Bash are:
The following Bash session shows you some of the above features:
# start a new Bash session
herong$ /bin/bash
herong@ubuntu$
# set the prompt to be 'bash$ ' by updating the built-in variable PS1
herong@ubuntu$ PS1='bash$ '
bash$
# run the built-in command 'help'
bash$ help
GNU bash, version 4.4.20(1)-release (x86_64-pc-linux-gnu)
These shell commands are defined internally. Type `help' to see this list.
Type `help name' to find out more about the function `name'.
Use `info bash' to find out more about the shell in general.
Use `man -k' or `info' to find out more about commands not in this list.
...
# use sub-command substitution with '`' quotes
bash$ DIR=`pwd`
bash$ echo $DIR
/home/herong
# use filename substitution with wildcard characters
bash$ ls -ld D*
drwxr-xr-x 2 herong herong 4096 Nov 11 10:20 Desktop
drwxr-xr-x 2 herong herong 4096 Jul 9 2023 Documents
drwxr-xr-x 2 herong herong 4096 Dec 15 08:06 Downloads
# use output redirection with '>'
bash$ date > output
bash$ cat output
Mon Jan 1 01:01:01 EST 2026
# use execution pipe to send output of one command to another
bash$ ls -d D* | wc
3 3 28
# end the shell session
bash$ exit
exit
herong$
Table of Contents
Introduction to Ubuntu Systems
GNOME - Desktop Interface and Environment
►Shell - The Command-Line Interpreter
►What Is Bash (Bourne Again SHell)
Bash Command Line Interpretation Steps
Bash Shell Session Customization
Command Input/Output Redirection