Linux Bash Basics | Cyber Security Tutorial - Learn with VOKS
Advance AI Bootstrap C C++ Computer Vision Content Writing CSS Cyber Security Data Analysis Deep Learning Email Marketing Excel Figma HTML Java Script Machine Learning MySQLi Node JS PHP Power Bi Python Python for AI Python for Analysis React React Native SEO SMM SQL
Back Next

Linux Bash Basics

Learn this topic step-by-step with VOKS Tutorials.

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:

  • It takes your typed commands
  • Sends them to the operating system
  • Shows you the results

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:

  • Press Ctrl + Alt + T
  • OR
  • Search for "Terminal" in the applications menu

You’ll see something like:

user@computer:~$

This is called the prompt.

  • user = your username
  • computer = your system name
  • ~ = your home directory
  • $ = regular user

If 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 software

Your 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:

  1. Lists files
  2. Creates a folder
  3. Enters the folder
  4. Creates a file
  5. Lists contents
  6. Displays file content
  7. Goes back
  8. Deletes the folder

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
  • command = ls
  • option = -l

3. Everything Is a File

In Linux:

  • Regular files are files
  • Folders are files
  • Devices are files
  • Processes are treated like files internally

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
QUICK KNOWLEDGE CHECK

Test Your Understanding

Answer 5 questions generated from this lesson. Your result is calculated instantly and is not saved.

0 / 5 answered
All Courses
Advance AI Bootstrap C C++ Computer Vision Content Writing CSS Cyber Security Data Analysis Deep Learning Email Marketing Excel Figma HTML Java Script Machine Learning MySQLi Node JS PHP Power Bi Python Python for AI Python for Analysis React React Native SEO SMM SQL
Course contents
Cyber Security
01 Introduction 02 Types of Cyber Threats 03 Cyber Security Domains 04 CIA Triad (Confidentiality Integrity Availability) 05 Career paths in Cyber Security 06 Certifications 07 Ethics and Responsible Disclosure 08 Laws and Regulation (e.g. GDPR, NDPR) 09 What is an OS? 10 Types: Window, Linus, macOS 11 Command-line vs GUI 12 OS Internals Overview (filesystems, processes, permissions) 13 Windows command prompt basics 14 Linux Bash Basics 15 File System Navigation 16 Basic Scripting 17 IP Addressing 18 DNS, DHCP 19 Mac Address 20 OSI VS TCP/IP Models 21 Ports and Protocols (TCP, UDP) 22 Common Protocols (HTTPS, FTP, SSH, etc.) 23 Packet structure 24 Firewalls, IDS/IPS, VPNs 25 Common attacks: MITM, Sniffing 26 Secure Network Practices 27 How the Web works 28 HTTP vs HTTPS 29 URLs, Headers, Cookies 30 Client-Server Architecture 31 Introduction To Web Security 32 OWASP Top 10 Overview 33 Common Threats (XSS, SQLi, CSRF) 34 Inpute validation and authentication flow 35 Basic Exploitation demo (e.g. XSS) 36 Burp Suite Introduction 37 Using a Browser For Testing 38 Password security 39 MFA-Antivirus 40 Cyber Hygeine Practice 41 Intro To Tools: Nmap, Wireshark, Netstat