
Linux Basics for Cybersecurity
Mastering Linux is essential for every cybersecurity enthusiast. Most security tools are built for Linux, and it offers unmatched control, flexibility, and open-source power.
Why Linux is Important in Cybersecurity
Most hacking tools (like Nmap, Metasploit, Wireshark) are built for Linux.
Cybersecurity distributions like Kali Linux, Parrot OS, etc., are Linux-based.
Servers, IoT devices, routers, and cloud platforms commonly run Linux.
It provides full command-line control over system processes, networking, and security.
Linux File System Structure (Very Basics)
Linux has a hierarchical file system starting with the root /.
Directory Purpose
/ - Root of everything
/home/ - User folders (like /home/user)
/etc/ - Configuration files
/bin/ - Essential commands like ls, cp, mv
/var/ - Logs and runtime files
/opt/ - Optional software
/tmp/ - Temporary files
/usr/ - User-installed software and libraries
Basic Linux Commands
Here are essential commands every cybersecurity beginner must know:
File & Directory Management
pwd – Show current directory
ls – List files in directory
cd – Change directory
mkdir – Create a folder
touch – Create a file
rm – Delete file or folder
cp – Copy files/folders
mv – Move or rename files
Example :
cd /home/user
mkdir test
touch myfile.txt
rm myfile.txt
Viewing File Content
cat – View file contents
less – Scroll through large files
head – View beginning of file
tail – View end of file
System Info & Monitoring
uname -a – System info
top or htop – Running processes
df -h – Disk usage
free -h – RAM usage
Package Management
For Debian-based systems (Kali, Ubuntu):
sudo apt update – Refresh package list
sudo apt install nmap – Install a tool
sudo apt remove toolname – Uninstall tool
Linux User & Permissions
User Management
whoami – Current user
adduser user – Add new user
passwd user – Change password
su user – Switch user
File Permissions
Linux uses a permissions system:
r = read
w = write
x = execute
Example:
chmod +x script.sh # make a script executable
chown user file.txt # change file ownership
Linux Networking Basics
Important commands:
ifconfig or ip a – View IP address
ping domain.com – Check connectivity
netstat -tuln – View open ports
nmap 192.168.1.1 – Scan for open ports (requires install)
curl or wget – Fetch web pages or download files
Linux Tools for Cybersecurity Beginners
Some common tools that run on Linux:
Tool Purpose
nmap Network scanning
netcat (nc) Network utility (reverse shells, etc.)
Wireshark Packet sniffing
tcpdump Command-line packet capture
Hydra Brute-force password cracking
John the Ripper Password cracking
Burp Suite Web security testing
Metasploit Penetration testing framework