1. Introduction to Bash Shell
What is Bash: Bash (Bourne Again SHell) is a Unix shell and command language that is widely used
as the default shell on Linux and macOS systems.
History of Bash: Bash was developed by Brian Fox in 1989 as a free software replacement for the
Bourne shell (sh), adding features from the Korn shell (ksh) and C shell (csh).
Key Features: Bash supports command execution, scripting, command-line editing, job control, and
shell functions, making it powerful for both interactive use and automation.
2. Basic Bash Commands
Navigation: Commands like pwd, cd, ls, and tree are used for navigating and listing directories.
File Operations: Commands like cp, mv, rm, and mkdir allow for copying, moving, deleting, and
creating directories.
Viewing Files: cat, less, head, and tail are used for viewing files, while wc counts lines, words, and
characters in a file.
3. Variables and Environment
Shell Variables: Variables in Bash are used to store values like strings, numbers, and command
outputs. They are declared without a data type.
Environment Variables: Environment variables like PATH, HOME, and USER are global variables
that affect the behavior of the shell and system commands.
Exporting Variables: The export command is used to make a variable available to child processes or
scripts.
4. Input/Output Redirection
Redirection Operators: Bash allows for redirecting standard input, output, and error using operators
like >, >>, <, 2>, and &>.
Pipelines: The pipe operator (|) allows for connecting the output of one command as the input of
another command.