Skip to content
Learn Security

Introduction to the Open-Source Operating System

This article provides an introductory overview of Linux, an open-source operating system renowned for its stability and security. Covering basic concepts and commands, it offers a foundational understanding for cybersecurity professionals leveraging Linux-based tools in their security operations. Whether delving into penetration testing, digital forensics, or network security, Linux serves as a fundamental platform for cybersecurity endeavors.

A Complete Roadmap to Linux OS

Introduction to the Open-Source Operating System: Linux

If you spend any time in tech, you quickly realize that Linux is everywhere. It runs cloud infrastructure, enterprise servers, Android devices, network routers, and every one of the world’s top supercomputers. For most people, it hums along invisibly in the background. But for cybersecurity professionals, Linux is something else entirely — it is the foundation on which penetration testing, digital forensics, threat hunting, and security operations are built.

What makes Linux so central to security work is its open-source philosophy. Anyone can read the kernel source code, compile a custom build, or strip the OS down to exactly what a specific task requires. There are no hidden components and no relying on a vendor’s word about what the software actually does.

“Linux is not just an operating system; it’s a philosophy that empowers users with control, freedom, and security.” — Linus Torvalds

To work securely with Linux, you need to understand how the kernel coordinates between user applications and physical hardware. The diagram below shows the relationship between User Space — where regular processes run with restricted privileges — and Kernel Space, where the core OS manages hardware with full access rights.

%%{init: {'theme': 'dark', 'themeVariables': { 'background': '#0d1117', 'primaryColor': '#1e293b', 'primaryTextColor': '#e2e8f0' }}}%% graph TD classDef space fill:#1e293b,stroke:#88c0d0,stroke-width:2px,color:#eceff4; classDef component fill:#0f172a,stroke:#3b4252,stroke-width:2px,color:#eceff4; classDef security fill:#7f1d1d,stroke:#88c0d0,stroke-width:1px,color:#eceff4; subgraph UserSpace ["User Space (Restricted Privileges)"] App["User Applications
(Web Browser, Shell, Server)"]:::component Lib["System Libraries
(glibc)"]:::component end subgraph KernelSpace ["Kernel Space (Full Privileges)"] Syscall["System Call Interface
(sys_read, sys_write, etc.)"]:::component LSM["Linux Security Modules (LSM)
(AppArmor, SELinux)"]:::security KernelCore["Kernel Core Services
(Process, Memory, Network, VFS)"]:::component Drivers["Device Drivers & Hardware"]:::component end App --> Lib Lib -->|System Calls| Syscall Syscall --> LSM LSM -->|Access Decision| KernelCore KernelCore --> Drivers style UserSpace fill:#1e293b,stroke:#4c566a,stroke-width:2px,color:#88c0d0 style KernelSpace fill:#0f172a,stroke:#4c566a,stroke-width:2px,color:#88c0d0

Understanding the Linux Directory Structure

Linux organizes everything under a single root directory /. Following the Unix principle that “everything is a file” — including hardware devices, processes, and network sockets — the structure is standardized across all major distributions.

DirectoryStandard PurposeSecurity & Auditing Context
/The root directory that anchors the entire filesystem tree.Every path originates here. Unauthorized write access to root is a critical risk.
/binEssential user binaries required in single-user mode.Contains core commands like ls, cp, and bash. Audit for unauthorized modifications.
/sbinEssential system binaries reserved for administrative tasks.Contains utilities like iptables, reboot, and fdisk. Restricted to root or sudoers.
/bootBootloader configurations, kernel images (vmlinuz), and initramfs.Critical for boot integrity. Write-protect to prevent evil maid attacks and bootkits.
/devDevice nodes representing physical and virtual hardware.Contains devices like /dev/sda (raw storage) and /dev/urandom. Raw drive access must be restricted.
/etcSystem-wide configuration files and databases.Houses credentials (/etc/shadow), user lists (/etc/passwd), and service configs. A primary audit target.
/homeHome directories for standard users (e.g., /home/alice).Holds user files, shell history, and SSH keys. Often monitored for indicators of compromise.
/rootDedicated home directory for the superuser (root).Separated from /home to remain accessible if user storage partitions fail. Strictly privileged.
/lib & /lib64Shared libraries required by system binaries.Contains shared objects (.so files). Must be protected against library preloading and hijacking.
/media & /mntMount points for removable media and manual filesystem mounts.Used when mounting external drives during incident response or forensic analysis.
/optAdd-on application software packages.Third-party tools install here. Check regularly for unpatched binaries.
/procVirtual filesystem exposing kernel state and process details.Exists only in memory. Security tools query /proc/<PID>/ to inspect process memory and arguments.
/sysVirtual filesystem exposing hardware and driver parameters.Used to query and modify kernel configurations and security settings at runtime.
/tmpTemporary directory accessible by all users.Uses the Sticky Bit to limit deletion. Watch for staging files during exploitation or malware execution.
/usrUser binaries, libraries, documentation, and source code.Contains /usr/bin and /usr/share. Kept read-only on hardened systems.
/varVariable files such as mail queues, databases, and logs.Contains /var/log (syslog, auth logs). Forward logs off-host to prevent tampering.

Discretionary Access Control: File Permissions

Linux controls access through user ownership and permission bits. Every file and directory is assigned to an owner and a group. The system checks three tiers of access rights:

  1. User (u): The user who owns the file.
  2. Group (g): Members of the group associated with the file.
  3. Others (o): Everyone else on the system.

Running ls -l shows permissions as a character string like this:

-rwxr-xr-x 1 webadmin developers 1234 May 31 10:00 deploy.sh

Breaking it down:

  • The first character is the file type (- for regular file, d for directory, l for symlink).
  • The next nine characters are three permission triplets:
    • rwx (Owner): webadmin can read, write, and execute.
    • r-x (Group): The developers group can read and execute.
    • r-x (Others): Everyone else can read and execute.

For a full guide covering octal notation, special bits (SUID, SGID, Sticky Bit), and Access Control Lists (ACLs), see our dedicated post on Linux File Permissions and Ownership Management .


Essential Linux Commands

Almost all Linux work happens at the command line. Commands follow this general format:

command [options] [arguments]

These are the foundational commands you’ll use constantly:

CommandPurposeBasic Example
lsLists directories and file details. Use -la to show hidden files and permissions.ls -la /var/log
cdChanges the current working directory.cd /etc/ssh
pwdPrints the absolute path of the current directory.pwd
touchCreates an empty file or updates timestamps of an existing file.touch honeypot.log
rmRemoves files or directories. Use -r for recursive and -f to force.rm -rf /tmp/malicious_payload
chmodModifies access permissions on a file or directory.chmod 600 ~/.ssh/id_rsa
nano / vimTerminal-based text editors for editing configuration files.sudo vim /etc/hosts
manOpens the manual page for any command.man iptables

Advertisement

Why Choose Linux? A Cybersecurity Perspective

Linux offers real, measurable advantages over proprietary operating systems from a security standpoint:

  • Auditable Source Code: The kernel is open, so security researchers, enterprises, and government agencies can inspect every line. Vulnerabilities get found and patched by the community rather than waiting on a single vendor’s timeline.
  • Minimal Attack Surface: Unlike consumer operating systems that bundle dozens of services by default, a Linux installation can be stripped down to exactly what you need. Running servers without a GUI and disabling unused services means fewer entry points for attackers.
  • Granular Privilege Control: The root account is the absolute superuser, but day-to-day administrative tasks are delegated through sudo with strict logging. Access controls go further with mandatory security frameworks at the kernel level.
  • Native Hardening Frameworks: Linux Security Modules (LSMs) like SELinux and AppArmor enforce mandatory access controls that restrict processes to specific files and operations — limiting the blast radius when an application gets compromised.
  • Stability and Performance: Linux manages memory and system resources efficiently and almost never requires reboots. That matters for security infrastructure like firewalls and IDS/IPS that must stay online continuously.

Linux vs. Windows: The Enterprise Security Battle

FeatureLinuxWindows
Security ArchitectureDiscretionary Access Control (DAC) with optional MAC via SELinux or AppArmor. Low kernel footprint.Discretionary Access Control (DAC) with Mandatory Integrity Control (MIC) and Active Directory integration.
Attack Surface & VectorsPrimarily targeted via web application exploits, unpatched network services, misconfigured permissions, and container breakouts.Historically targeted by user-focused malware, phishing, macro scripts, Active Directory credential harvesting, and local privilege escalation.
Patching OperationsSoftware repositories allow seamless system updates. Supports live-patching to update a running kernel without reboots.Windows Update handles OS patches, but major security updates often require reboots, causing downtime.
Transparency & AuditabilityOpen-source. Enables binary verification, reproducible builds, and deep code inspection by anyone.Closed-source. Relies on vendor trust and third-party EDR integrations for visibility.
CustomizabilityHighly customizable — unused kernel modules, libraries, and utilities can be removed to reduce the attack surface.Monolithic design makes stripping core components difficult, leaving a larger software footprint.

Because Linux is open-source, developers package the kernel with different tools, libraries, and package managers to create distinct distributions. Picking the right one depends on what you’re doing:

  • Ubuntu & Debian: Ubuntu is user-friendly and widely supported, making it a popular choice for developers and cloud deployments. Debian is renowned for rock-solid stability and conservative package updates — a reliable base for production servers.
  • Red Hat Enterprise Linux (RHEL), Fedora & Rocky Linux: The standard in enterprise environments. These distros ship with SELinux policies enabled by default and offer commercial support, which matters for compliance-heavy organizations.
  • Arch Linux: A minimalist rolling-release distro built for advanced users. You start with a bare shell and build up exactly the system you want. Maximum flexibility, but it demands hands-on maintenance.
  • Kali Linux & Parrot OS: Debian-based distributions configured specifically for penetration testing and digital forensics. They come preloaded with hundreds of security tools, from packet sniffers to exploitation frameworks.
  • Alpine Linux: An ultra-lightweight distro (~5MB base) built around BusyBox and musl libc. It is heavily used in Docker containers because a tiny image means a dramatically smaller attack surface.
  • Tails & Qubes OS: Tails runs entirely from RAM and routes all traffic through Tor, leaving no forensic traces on disk. Qubes OS enforces security through compartmentalization, isolating applications in separate Xen virtual machines.

Modern Networking and Connectivity Commands

Understanding network traffic and socket states is essential for both troubleshooting and detecting intrusions.

[!NOTE] Legacy tools like ifconfig and netstat are deprecated in modern distributions. They have been replaced by faster, more capable utilities from the iproute2 package.

Modern UtilityLegacy ReplacementDescriptionCommon Usage
ip addrifconfigDisplays IP addresses, MAC addresses, and network interface configurations.ip a or ip addr show
ssnetstatInvestigates active sockets and shows listening network ports.ss -tulpn (TCP/UDP listeners with PIDs)
pingN/ASends ICMP echo requests to test connectivity to a host.ping -c 4 10.0.0.1
tracerouteN/AMaps the routing path packets take to reach a destination.traceroute 8.8.8.8
curl / wgetN/ACommand-line HTTP clients for downloading files or querying APIs.curl -I https://example.com
sshN/AOpens encrypted interactive sessions and port forwards to remote hosts.ssh -i key.pem user@host
# Identify listening ports and the processes behind them
sudo ss -tulpn

Frequently Asked Questions

Q: Is Linux inherently more secure than Windows?

Linux was designed with strict privilege separation, and its open-source nature means vulnerabilities often get patched quickly. That said, no operating system is secure by default. A poorly configured Linux server with weak SSH passwords, open ports, and unpatched web applications is just as exploitable as any Windows machine. Security comes down to configuration, hardening, and continuous monitoring — not the OS logo.

Q: Can Linux systems be infected by malware?

Absolutely. Classic desktop viruses are less common on Linux, but servers are a prime target. Linux malware typically takes the form of ELF-based rootkits, persistent backdoors, PHP shells, and IoT botnets like Mirai. Ransomware groups also actively target VMware ESXi hypervisors and cloud infrastructure running Linux kernels.

Q: Is Linux harder to learn than Windows?

The learning curve is steeper at first because Linux relies heavily on the command line rather than a graphical interface. But that investment pays off — it unlocks the ability to automate complex tasks, manage remote servers efficiently, and write scripts that would take hours to do manually through a GUI.


Additional Resources


Advanced Linux Concepts

Once you’re comfortable with basic commands, learning shell scripting and kernel-level process management is what separates casual users from people who can actually operate and secure Linux systems at scale.

Shell Scripting and Automation

Shell scripts let you chain commands together and automate recurring tasks — things like backups, log rotation, or system health checks. Here is a practical backup script with input validation and logging:

#!/bin/bash
# Backup Script with basic input validation and logging

SOURCE_DIR="/var/www/html"
BACKUP_DIR="/opt/backups"
TIMESTAMP=$(date +"%Y%m%d_%H%M%S")
LOG_FILE="/var/log/backup_service.log"

# Verify execution as root or sudo
if [[ $EUID -ne 0 ]]; then
   echo "[CRITICAL] This backup script must be run as root." >&2
   exit 1
fi

# Validate source directory exists
if [ ! -d "$SOURCE_DIR" ]; then
    echo "[ERROR] Source directory $SOURCE_DIR not found. Aborting." >> "$LOG_FILE"
    exit 1
fi

mkdir -p "$BACKUP_DIR"
chmod 700 "$BACKUP_DIR"

# Execute backup using tar archiving
BACKUP_FILE="$BACKUP_DIR/backup_$TIMESTAMP.tar.gz"
tar -czf "$BACKUP_FILE" "$SOURCE_DIR" 2>> "$LOG_FILE"

if [ $? -eq 0 ]; then
    echo "[SUCCESS] Backup of $SOURCE_DIR saved to $BACKUP_FILE on $(date)" >> "$LOG_FILE"
    chmod 600 "$BACKUP_FILE"
else
    echo "[FAILED] Backup execution failed on $(date)" >> "$LOG_FILE"
fi

[!WARNING] Shell Scripting Security Best Practices:

  1. Never hardcode secrets. Keep API keys, database passwords, and private keys out of scripts. Use environment variables or a secrets manager like HashiCorp Vault.
  2. Restrict execution permissions. Run chmod 700 script.sh so only the owner can read and execute it.
  3. Quote all variables. Use "$VAR" to prevent word splitting, globbing, and command injection vulnerabilities.

Managing Processes and Signals

The Linux kernel tracks every running application by Process ID (PID). Processes run either in the foreground (blocking the terminal) or the background.

  • Background Execution: Append & to run a command without locking up your terminal:
    nmap -sV -p- 10.0.0.1 > scan_results.txt &
    
  • Signal Transmission: Processes respond to signals sent via the kill command:
    • SIGTERM (Signal 15): The default signal. Asks the process to clean up and exit gracefully.
    • SIGKILL (Signal 9): Forces the process to stop immediately at the kernel level, skipping any cleanup.
CommandDescription
topShows live system resource usage and process tables.
htopAn interactive, colorized process viewer with filtering.
ps auxSnapshot of all active processes on the system.
kill -15 <PID>Requests graceful termination of a process.
kill -9 <PID>Forces immediate termination of a process.
nice / reniceSets or adjusts the CPU scheduling priority of a process.

Package Management Systems

Package managers handle installation, configuration, and upgrades of software from cryptographically signed repositories. No manual downloads, no version hunting.

Distro FamilyPrimary ManagerInstall CommandUpdate System
Debian / Ubuntuaptsudo apt install ufwsudo apt update && sudo apt upgrade
RHEL / Rocky / Fedoradnf (formerly yum)sudo dnf install firewalldsudo dnf upgrade
Arch Linuxpacmansudo pacman -S nmapsudo pacman -Syu

[!IMPORTANT] Package managers verify integrity using GPG (GNU Privacy Guard) keys. If a package signature cannot be verified, the manager warns you and aborts — preventing the installation of tampered files.


Advertisement

Linux in Cybersecurity and Server Management

Linux dominates backend infrastructure, which means security teams need to understand both standard server administration and the security tooling built around the OS.

Tools for Security Operations and Pentesting

Modern security distributions come preconfigured with tools designed to analyze hosts, audit configurations, and reverse-engineer files:

  • Nmap: Port scanning, service version detection, and OS fingerprinting.
  • Metasploit Framework: A modular exploitation platform for validating vulnerabilities and executing controlled payloads.
  • Wireshark: A graphical packet analyzer that decodes protocols and inspects traffic interactions.
  • tcpdump: A lightweight command-line packet capture tool for headless servers where Wireshark isn’t available.
  • John the Ripper / Hashcat: High-performance password auditing tools for testing password database strength.

Linux as a Secure Server OS

Linux can be configured to fulfill specific network roles with minimal overhead:

  • Web Servers: Run Apache (httpd) or Nginx to serve static content or act as reverse proxies.
  • File Servers: Use Samba for Windows interoperability or NFS for Unix-to-Unix directory sharing.
  • Database Servers: Host PostgreSQL, MySQL, or MongoDB.
  • Reverse Proxies & Load Balancers: Distribute traffic using HAProxy, Nginx, or Traefik to keep applications highly available.

Enterprise-Grade Security Hardening Best Practices

Deploying a default Linux installation directly to the internet is asking for trouble. These five steps establish a hardened baseline:

1. Enable Automated Updates

Configure the system to apply security patches automatically. On Ubuntu or Debian, use unattended-upgrades:

sudo apt install unattended-upgrades
sudo dpkg-reconfigure --priority=low unattended-upgrades

2. Configure a Host Firewall

Limit open ports to exactly what you need. Use ufw to deny all incoming traffic except SSH and web services:

sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow 22/tcp comment 'SSH Access'
sudo ufw allow 80/tcp comment 'HTTP'
sudo ufw allow 443/tcp comment 'HTTPS'
sudo ufw enable

3. Harden the SSH Daemon

Edit /etc/ssh/sshd_config to disable root login and password authentication, enforcing key-based access only:

# Disable root logins over SSH
PermitRootLogin no

# Enforce SSH public key authentication
PasswordAuthentication no

# Limit login access to specific users
AllowUsers security_admin sysop

Test the configuration before restarting to avoid locking yourself out:

sudo sshd -t && sudo systemctl restart sshd

4. Monitor Log Files

Audit authentication logs regularly for brute-force indicators:

  • Systemd Journal: Query active logs with journalctl:
    sudo journalctl -u ssh -g "Failed password" -f
    
  • Fail2Ban: Automatically block IPs that exceed login failure thresholds:
    sudo apt install fail2ban
    sudo systemctl enable --now fail2ban
    

5. Audit Local SUID Binaries

Find executables that run with root privileges and confirm no untrusted binaries have been granted these permissions:

find / -perm -4000 -type f 2>/dev/null

Take Your Linux Skills Further

  • “The Linux Command Line” by William Shotts — An excellent introduction to terminal usage for all skill levels.
  • “Linux Basics for Hackers” by OccupyTheWeb — Perfect for understanding Linux through a security and offensive tooling lens.
  • “How Linux Works” by Brian Ward — A deep dive into kernel internals, the boot process, and device drivers.

Online Training


100 Essential Linux Commands

The following reference guide covers 100 essential Linux commands organized by function, with descriptions and usage examples.

1. File and Directory Operations

CommandDescriptionUsage Example
lsLists files and directories in the current folder.ls -lh
cdChanges the current working directory.cd /var/log
pwdDisplays the absolute path of the current directory.pwd
mkdirCreates a new empty directory.mkdir -p /opt/data/scripts
rmdirRemoves an empty directory.rmdir /tmp/empty_dir
rmDeletes files or directories.rm -rf /tmp/staging_area
cpCopies files or folders to a new destination.cp config.conf config.conf.bak
mvMoves or renames files and directories.mv temp_file.txt /var/www/
touchCreates an empty file or updates access timestamps.touch access.log
lnCreates symbolic links to files or folders.ln -s /etc/nginx/sites-available/app /etc/nginx/sites-enabled/
findSearches for files by name, size, or permissions.find /etc -name "*.conf"
locateSearches files quickly using a pre-indexed database.locate shadow
statShows detailed filesystem metadata about a file.stat /etc/shadow
fileIdentifies the file type and encoding.file /bin/bash
treeDisplays directory contents in a nested tree structure.tree -d /var/log
CommandDescriptionUsage Example
catPrints file contents to the terminal.cat /etc/hostname
lessOpens file contents in an interactive pager.less /var/log/syslog
moreOlder, simple file pager for reading in the console.more /var/log/messages
headDisplays the first lines of a file (default: 10).head -n 20 /etc/passwd
tailDisplays the last lines of a file.tail -f /var/log/auth.log
grepSearches text using patterns or regular expressions.grep -i "failed" /var/log/auth.log
awkText scanning and processing language.awk -F: '{print $1}' /etc/passwd
sedStream editor for filtering and transforming text.sed -i 's/PermitRootLogin yes/PermitRootLogin no/g' sshd_config
cutExtracts sections from each line of a file.cut -d',' -f1 users.csv
sortSorts lines of text alphabetically or numerically.sort -n numbers.txt
uniqFilters duplicate lines from a sorted file.uniq -c sorted_ips.txt
wcCounts lines, words, and characters in a file.wc -l access.log
diffCompares two files and shows the differences.diff config.old config.new
teeRedirects stdin to both stdout and a file simultaneously.`echo “baseline”
xargsPasses output from one command as arguments to another.`find /tmp -name “*.log”

3. System Information and Hardware

CommandDescriptionUsage Example
unamePrints OS and kernel release information.uname -a
hostnameDisplays or sets the system hostname.hostname -f
uptimeShows how long the system has been running and CPU load.uptime
whoamiDisplays the effective user ID of the current shell.whoami
whoLists users currently logged into the system.who
wShows who is logged in and what they are running.w
lastDisplays a historical record of logged-in users.last -n 10
dmesgPrints messages from the kernel ring buffer.`dmesg -T
lshwShows detailed system hardware information.sudo lshw -short
lspciLists PCI buses and attached devices.lspci

4. Disk Management and Filesystems

CommandDescriptionUsage Example
dfReports filesystem disk space usage.df -h
duEstimates directory and file sizes.du -sh /var/www/*
lsblkLists block devices (hard drives, partitions).lsblk
mountMounts a physical or network filesystem.mount /dev/sdb1 /mnt/backup
umountUnmounts a mounted filesystem.umount /mnt/backup
fdiskModifies partition tables on block devices.sudo fdisk -l
partedModern partition tool supporting GPT.sudo parted /dev/sda print
mkfsFormats a partition with a filesystem type.sudo mkfs.ext4 /dev/sdb1
fsckChecks and repairs filesystem errors.sudo fsck /dev/sdb1
blkidDisplays UUIDs and properties of block devices.sudo blkid

5. Process Management and Performance

CommandDescriptionUsage Example
psLists a snapshot of active processes.`ps aux
topReal-time process monitoring.top
htopInteractive, user-friendly process viewer.htop
killSends a signal to a process.kill -15 1234
killallKills processes by name.killall apache2
pkillSends signals to processes matching a search string.pkill -u www-data
pgrepLists PIDs of processes matching a name.pgrep sshd
bgSends a suspended process to the background.bg %1
fgPulls a background process to the foreground.fg %1
jobsLists active jobs in the current terminal session.jobs

6. User, Group, and Privilege Management

CommandDescriptionUsage Example
sudoRuns a command with elevated root privileges.sudo apt update
suSwitches the session to another user.su - admin
idDisplays UID, GID, and group memberships for a user.id webadmin
passwdChanges passwords or locks user accounts.passwd alice
useraddCreates a new user on the system.sudo useradd -m bob
userdelRemoves a user and their home directory.sudo userdel -r bob
usermodModifies user settings and group memberships.sudo usermod -aG sudo bob
groupaddCreates a new user group.sudo groupadd pentesting
groupdelDeletes a user group.sudo groupdel pentesting
chageManages password expiration policies.sudo chage -l alice

7. Networking and Connectivity

CommandDescriptionUsage Example
pingSends ICMP echo requests to verify connectivity.ping -c 5 google.com
ipManages interface configurations and routing.ip route show
ssShows active socket connections (replaces netstat).ss -antp
tracerouteMaps network hops to a destination.traceroute 1.1.1.1
nslookupQueries DNS servers to resolve hostnames.nslookup target.local
digAdvanced DNS lookup tool (preferred over nslookup).dig MX google.com
curlCommand-line HTTP client for requests and downloads.curl -O https://example.com/payload.txt
wgetStandard file downloader over HTTP/FTP.wget -c https://example.com/iso.img
sshOpens secure encrypted sessions on remote hosts.ssh sysop@192.168.1.50
scpCopies files securely between hosts over SSH.scp local_file.txt user@host:/var/www/
rsyncEfficient incremental directory sync tool.rsync -avz /src/ /backup/
netstatLegacy network analysis tool.netstat -an
ifconfigLegacy network interface manager.ifconfig eth0
nmapPort scanner and network security mapper.nmap -sS -p 22,80,443 192.168.1.0/24
tcpdumpCaptures raw packet traffic on an interface.sudo tcpdump -i eth0 port 80 -w web.pcap

8. Package Management

CommandDescriptionUsage Example
aptPackage manager for Debian and Ubuntu.sudo apt install fail2ban
dnfPackage manager for Fedora, Rocky, and RHEL.sudo dnf install httpd
pacmanPackage manager for Arch Linux.sudo pacman -Syu
dpkgInstalls or removes local .deb packages.sudo dpkg -i package.deb
rpmInstalls or removes local .rpm packages.sudo rpm -ivh package.rpm

9. Compression and Archiving

CommandDescriptionUsage Example
tarArchives files (-c create, -x extract).tar -czvf backup.tar.gz /var/www
gzipCompresses a file using GNU zip.gzip logs.txt
gunzipDecompresses gzip files.gunzip logs.txt.gz
zipCompresses files into a zip archive.zip -r web.zip /var/www/html
unzipExtracts a zip archive.unzip web.zip -d /opt/web

10. Shell Builtins and Command History

CommandDescriptionUsage Example
echoPrints text to terminal output.echo $PATH
historyLists previously typed commands.history 15
aliasDefines shortcuts for commands.alias ll='ls -la'
clearClears the terminal display.clear
exitCloses the current shell session.exit

Pro Tip: Use man <command> to pull up the full manual page for any command — it shows all available flags, options, and usage examples.

Keep experimenting, keep learning!


Share article

Subscribe to my newsletter

Receive my case study and the latest articles on my WhatsApp Channel.

Warning