bash

💻 Cybersecurity Basics: Bash Explained Simply (Beginner Guide)

If you want to learn:

  • 🛡️ Ethical hacking
  • 🔎 Network analysis
  • 🐧 Kali Linux
  • 🎓 CEH preparation

You must understand Bash.

👉 Bash is the language of the Linux terminal.
👉 Most cybersecurity tools run in Linux.
👉 Real hackers don’t click — they type.

💡 Good news: Bash is much simpler than it looks.


🧠 The Big Analogy: Bash = Talking to Your Computer Directly

Using a graphical interface (GUI) is like:

Clicking buttons in a restaurant app 🍔

Using Bash is like:

Talking directly to the chef 👨‍🍳

Instead of clicking folders, you type instructions.

👉 Bash gives you direct control over the system.


1️⃣ What Is Bash?

Bash (Bourne Again Shell) is:

  • A command-line interface
  • A scripting language
  • The default shell on most Linux systems

📌 Bash allows you to:

  • Navigate files
  • Create and delete data
  • Run programs
  • Automate tasks

2️⃣ What Is the Terminal?

The terminal is the window where you type Bash commands.

You’ll see something like:

user@kali:~$

Breakdown:

  • user → your username
  • kali → your computer name
  • ~ → your current directory
  • $ → ready for command

👉 When you see $, you can type.


3️⃣ Navigating Files (The Most Important Skill)

Think of your computer like a house 🏠
Folders = rooms
Files = objects


pwd

👉 Shows your current directory
Analogy: “Which room am I in?”


ls

👉 Shows files and folders
Analogy: “What’s inside this room?”


cd Documents

👉 Moves into Documents folder
Analogy: “Go to another room”


cd ..

👉 Moves up one directory
Analogy: “Go back to the hallway”


4️⃣ Creating & Managing Files


touch notes.txt

👉 Creates empty file


mkdir lab

👉 Creates a new directory


rm notes.txt

⚠️ No recycle bin in Bash!


rm -r lab

👉 Deletes directory and contents


5️⃣ Viewing File Content


cat notes.txt

less notes.txt

Press:

  • q to quit
  • Arrow keys to scroll

6️⃣ Searching in Bash


find /home -name notes.txt

grep "password" notes.txt

👉 Finds lines containing the word “password”

🧠 This is heavily used in cybersecurity.


7️⃣ Permissions (Very Important)

In Linux, everything has permissions.

Run:

ls -l

Example output:

-rw-r--r-- 1 user user 0 file.txt

Breakdown:

  • r = read
  • w = write
  • x = execute

🧠 Analogy:
Permissions = who has the key to the room


chmod +x script.sh

👉 Makes script executable


8️⃣ Running Programs


./script.sh

sudo apt update
sudo apt upgrade -y

👉 sudo = run as administrator

🧠 Analogy:
sudo = master key 🔑


9️⃣ Pipes & Redirection (Power Feature)

This is where Bash becomes powerful.


ls > files.txt

ls >> files.txt

cat notes.txt | grep password

👉 Takes output from one command and sends it to another.

🧠 Analogy:
Pipe = conveyor belt in factory 🏭


🔟 Bash in Cybersecurity

Bash is used to:

  • Run Nmap scans
  • Launch Metasploit
  • Analyze logs
  • Parse data
  • Automate attacks
  • Create scripts

Example:

nmap -sV 192.168.1.1

👉 Scan target for services


🛡️ Beginner Bash Practice Plan

Week 1:

  • Navigate directories
  • Create/delete files

Week 2:

  • Practice grep & find
  • Learn permissions

Week 3:

  • Write simple scripts
  • Combine commands

📜 Simple Bash Script Example

Create file:

nano hello.sh

Add:

#!/bin/bash
echo "Hello Cybersecurity World"

Save and exit.

Make executable:

chmod +x hello.sh

Run:

./hello.sh

🎉 You wrote your first Bash script!


⚠️ Beginner Mistakes to Avoid

❌ Using rm -rf without understanding
❌ Running commands blindly
❌ Using sudo everywhere
❌ Ignoring permissions


🧭 Key Takeaways

💻 Bash = direct system control
📂 Navigation is foundational
🔐 Permissions are critical
⚙️ Pipes make Bash powerful
🛡️ Every ethical hacker uses Bash

👉 Mastering Bash is your first real step into cybersecurity.

If you enjoyed this guide, you’ll love the Back2Skills learning platform, built specifically for beginners who want to understand cybersecurity step by step.

Beginner-friendly lessons

Real ethical hacking concepts explained simply

CEH-aligned cybersecurity training

Clear roadmap from basics → ethical hacker


Scroll to Top