Skip to main content

Bash Shell

What is Bash?

Bash stands for:

Bourne Again Shell

It is the default shell for most Linux distributions.

Architecture

User

Terminal

Bash

Kernel

Hardware

Responsibilities of Bash

  • Execute commands
  • Manage variables
  • Handle scripts
  • Perform expansions
  • Manage jobs

Check Current Shell

echo $SHELL

Example:

/bin/bash

Start New Bash Session

bash

Exit:

exit

Features

✅ Variables ✅ Pipes ✅ Redirections ✅ Job Control ✅ Tab Completion ✅ Scripting

Bash Configuration Files


System-wide

/etc/profile

User Configuration

~/.bashrc

Login Shell

~/.profile

Reload Configuration

source ~/.bashrc

Bash Prompt

Example:

aayan@ubuntu:~$

Meaning:

PartDescription
aayanUsername
ubuntuHostname
~Current directory
$Normal user

Root user:

root@ubuntu:~#

Useful Bash Commands

History:

history

Aliases:

alias

Shell variables:

set

Environment variables:

env

Why Bash Matters

Bash is essential for:

  • Linux Administration
  • Ethical Hacking
  • DevOps
  • Server Automation
  • PocketMine Hosting

Summary

Bash is the heart of Linux command-line operations.