Understanding the operating system behind almost every server, security tool, and hacking lab you will ever touch, all the way from the kernel up to your first bash script.
Four modules, starting from "what even is Linux" and ending with you writing a working script.
What Linux is, where it came from, and why it matters for security work.
Navigating, managing files, permissions, processes, networking, and packages.
Variables, conditionals, loops, and your first real automation script.
Key takeaways and how this connects to the rest of the guide.
Talks to hardware, manages processes & memory
Ubuntu, Debian, Kali, Fedora…
A short timeline, because knowing where a tool's philosophy comes from helps you reason about how it behaves.
Kali, Parrot, BlackArch.Distros are families. Once you know one well, the others feel familiar.
Uses apt. Huge community, beginner-friendly, the default choice for most security tooling.
Uses dnf/yum. Common in enterprise servers and corporate environments.
Uses pacman/apk. Minimal, fast, popular for containers and advanced users.
Firefox, Nmap, VS Code, your own scripts…
bash, zsh. Interprets the commands you type
Processes, memory, drivers, system calls
CPU, RAM, disk, network card
Every layer only talks to its direct neighbor. Your browser never touches the CPU directly. It asks the kernel, which asks the hardware. That separation is what keeps the system stable and secure.
The window/program that displays text input and output. It's just the "screen."
The program that interprets your commands: bash, zsh, fish. This is the "brain."
A physical or virtual direct-access screen tied to the machine itself, not a separate window.
Every Linux distro arranges files this way. Once you learn it, you can navigate any Linux machine on earth.
pwd: print your current directory (where am I?).ls / ls -la: list files; -l for details, -a to show hidden files.cd path: change directory; cd .. goes up one level, cd ~ goes home./ (e.g. /home/user/notes). Relative path: starts from where you are now.mkdir name: create a directory. touch file: create an empty file.cp src dst: copy. mv src dst: move or rename.rm file: delete a file. rm -r dir: delete a directory and its contents.ln -s target link: create a shortcut (symbolic link) to another file or folder.rm -rf has no undo and no recycle bin. Always double-check your path before pressing enter.cat file: dump the whole file to the screen.less file: scroll through a long file page by page (q to quit).head -n 10 file: first 10 lines. tail -n 10 file: last 10 lines.tail -f file: follow a file live as new lines are written. This is exactly how you watch a log in real time.find . -name "*.log": search by filename, type, or size, starting from a folder.locate file: instant search using a prebuilt index (faster, but can be slightly outdated).grep -rin "password" .: search file contents. -r recursive, -i case-insensitive, -n show line numbers.* any characters, ? one character, [abc] one of a set.Finding the data is half the job. These commands shape it into something useful.
cut -d',' -f2 file.csv: pull out one column from delimited text.sort file.txt / sort -n / sort -r: sort lines alphabetically, numerically, or in reverse.uniq: collapse adjacent duplicate lines. Pair it with sort -u for a clean unique list.wc -l file: count lines (-w words, -c characters).sed 's/old/new/g' file: find and replace text, line by line.awk '{print $1}' file: pull out specific fields from structured text.chmod 755 file or chmod u+x file: change permissions (numeric or symbolic).chown user:group file: change who owns the file.ps aux: snapshot of every running process.top / htop: live, updating view of CPU & memory usage per process.kill PID / kill -9 PID: politely ask, then forcefully stop, a process.command & runs in the background; jobs, fg, bg manage it.Before you fix or secure anything, you need to know exactly what you're working with.
whoami / id: who am I, and which groups do I belong to?uname -a: kernel version and system architecture.df -h: disk space used per filesystem, in human-readable form.du -sh folder: how much space a specific folder is taking up.free -h: RAM and swap usage.history: your most recent commands, useful for replaying or auditing what you ran.man command or command --help opens its manual. which command tells you exactly which binary will run.apt: Debian, Ubuntu, Kali. dnf/yum: Fedora, RHEL. pacman: Arch.sudo apt update: refresh the list of available packages.sudo apt install nmap: install a tool by name.sudo apt remove nmap: uninstall it again.A handful of commands you'll reach for constantly once you leave the local filesystem.
ip aList network interfaces and their IP addresses.
ping hostCheck whether a host is reachable.
curl / wgetFetch a web resource straight from the terminal.
ssh / scpLog into, or copy files to, a remote machine.
sha256sum fileFingerprint a file to verify it hasn't been tampered with.
tar -czvf out.tar.gz dir/Compress a folder into a single archive.
unzip file.zipExtract a zip archive's contents.
sha256sum against the value published by its source is exactly how you confirm an ISO or tool hasn't been swapped for a malicious copy.>Send output to a file, overwriting it.
>>Send output to a file, appending to it.
<Feed a file in as input to a command.
|Pipe: send one command's output straight into the next.
Example: count how many shell scripts are in this folder.
#!/bin/bash.myscript.sh, then make it executable: chmod +x myscript.sh../myscript.sh (or bash myscript.sh without the chmod step).name=value. No spaces around the =. Use it with a $: $name.read -p "Prompt: " var: ask the user for input and store it.$1, $2…: positional arguments passed to the script. $#: how many were given.if [ condition ]; then … elif … else … fi: the basic shape.-eq equal, -f file file exists, -z "$v" empty string, == string match.[[ … ]] are a more forgiving, modern alternative to [ … ].for f in *.log; do … done: repeat once per item in a list.while [ condition ]; do … done: repeat while something stays true.name() { … }: define a reusable function; call it later just by typing name.Everything from today, in one small, real script.
Let's open a terminal and start practicing. The best way to learn Linux is to break it, then fix it.