What Is Bash?
Bash stands for:
Bourne Again Shell
It is a program that lets you control Linux by typing commands.
It is a shell, which means:
You interact with Bash using a program called the Terminal.
Instead of clicking with a mouse, you type instructions.
Opening the Terminal
On most Linux systems:
Ctrl + Alt + TYou’ll see something like:
user@computer:~$
This is called the prompt.
user = your usernamecomputer = your system name~ = your home directory$ = regular userIf you see #, that means you are the root (administrator) user.
Understanding the Filesystem
Linux organizes files in a tree structure.
The top of the tree is:
/
This is called the root directory.
Important directories:
/home → user files/etc → system configuration/bin → essential programs/usr → installed softwareYour personal files are usually in:
/home/yourname
Shortcut:
~
means your home directory.
Basic Navigation Commands
Show Files
ls
List with details:
ls -l
List hidden files:
ls -a
Change Directory
cd foldername
Go back one level:
cd ..
Go to home directory:
cd ~
Go to root directory:
cd /
Creating and Deleting
Create a Folder
mkdir MyFolder
Remove a Folder
rmdir MyFolder
If the folder contains files:
rm -r MyFolder
Create a File
touch file.txt
Delete a File
rm file.txt
Viewing File Contents
Show file content:
cat file.txt
View long files page by page:
less file.txt
Copying and Moving Files
Copy a file:
cp file.txt backup.txt
Move or rename a file:
mv file.txt newname.txt
Permissions Basics
Linux uses read, write, and execute permissions.
View permissions:
ls -l
Change permissions:
chmod 755 file.txt
Running Programs
Run a program:
programname
Run a script:
bash script.sh
Make a script executable:
chmod +x script.sh ./script.sh
Getting Help
Most commands have built-in help.
man ls
Or shorter help:
ls --help
A Simple Practice Session
ls mkdir TestFolder cd TestFolder touch hello.txt ls cat hello.txt cd .. rm -r TestFolder
What this does:
Important Concepts
1. Case Sensitivity
Linux IS case-sensitive.
These are different:
file.txt File.txt FILE.txt
2. Command Structure
Most Bash commands follow this pattern:
command [options] [target]
Example:
ls -l
3. Everything Is a File
In Linux:
This is a very important Linux concept.
ls
ls -l
ls -a
cd foldername
cd ..
cd ~
cd /
mkdir MyFolder
rmdir MyFolder
rm -r MyFolder
touch file.txt
rm file.txt
cat file.txt
less file.txt
cp file.txt backup.txt
mv file.txt newname.txt
ls -l
chmod 755 file.txt
programname
bash script.sh
chmod +x script.sh
./script.sh
man ls
ls --help
ls
mkdir TestFolder
cd TestFolder
touch hello.txt
ls
cat hello.txt
cd ..
rm -r TestFolder