BASH
Platform Ops OS Linux Fundamentals
Issue #054 · September 2026

LINUX FUNDAMENTALS

Filesystem · Permissions · Packages · Processes · Shell

The ground floor every other Linux topic stands on. If you've been copy-pasting chmod 777 for years without knowing why it works, start here.

15
Concepts Covered
1
of 4 Linux Resources
RHEL
/ Debian Family
Filesystem3
FHSfstabSymlinks
Permissions3
chmod/chownsudoSetUID
Packages3
apt/dnfReposSource Builds
Processes3
ps/topSignalssystemctl
Shell3
Bash Scriptsgrep/sed/awkPipes
/etc /var /usr /optchmod / chownsudoersapt / dnf / yumps auxSIGTERM / SIGKILLsystemctlgrep / sed / awkBash ScriptingSymbolic Links /etc /var /usr /optchmod / chownsudoersapt / dnf / yumps auxSIGTERM / SIGKILLsystemctlgrep / sed / awkBash ScriptingSymbolic Links

FIVE LAYERS OF A LINUX BOX

From the directory tree to the shell you type into — the five layers that make up everything else in this series.

🔴 Filesystem
FHS Layout
Mount Points
/etc/fstab
Hard/Symlinks
/proc /sys
🟠 Permissions
rwx Bits
Users & Groups
sudo / sudoers
SetUID/GID
Sticky Bit
🔵 Packages
apt (Debian)
dnf/yum (RHEL)
Repositories
GPG Signing
Source Builds
🟢 Processes
ps / top / htop
Process Tree
Signals
Job Control
systemctl Basics
🟣 Shell
Bash Scripting
grep/sed/awk
Pipes & Redirects
Env Variables
Cron Basics
Deep-Dive

FUNDAMENTALS REFERENCE

Click any layer to explore concepts, commands, and production-tested guidance.

FILESYSTEM HIERARCHY
Where everything lives, and why it's not arbitrary
3 Concepts
📁
The FHS Standard
The Filesystem Hierarchy Standard defines what belongs where — so any two Linux distros are navigable the same way.
Must Know
Must Know
PathContains
/etcSystem-wide configuration files
/varVariable data — logs, spool files, caches
/usrUser-installed software & libraries (most of the OS actually lives here)
/optThird-party/manually installed applications
/proc, /sysVirtual filesystems — kernel & process state, not real files on disk
🔗
Mounting & /etc/fstab
A filesystem isn't accessible until it's mounted somewhere in the tree — fstab is what makes that happen automatically at boot.
Important
Important
/etc/fstab entry
fstab
# device mountpoint fstype options dump pass
UUID=a1b2c3 /data ext4 defaults 0 2
Commands
mount
mount -a # mount everything in fstab
df -hT # what's mounted where, with type
findmnt /data
🔀
Symbolic vs Hard Links
Two ways to make one file answer to two names — with very different behavior when the original is deleted.
Concept
Recommended
Symbolic (soft) link
🔵A pointer to a path — ln -s target link
🔵Breaks ("dangling") if the target is deleted or moved
🔵Can cross filesystems, can link to directories
Hard link
1
ln target link — both names point to the same inode
2
File data isn't freed until every hard link is removed
3
Cannot cross filesystems, cannot link to directories
USERS, GROUPS & PERMISSIONS
rwx isn't complicated — it's just rarely explained properly
3 Concepts
🔐
rwx Permission Bits & chmod/chown
Three permission triplets — owner, group, other — each with read/write/execute. Everything else is built on this.
Must Know
Must Know
permissions
ls -l app.sh
-rwxr-xr-- 1 vishal devs 842 app.sh
# owner: rwx group: r-x other: r--
chmod 750 app.sh # same thing, numeric form
chown vishal:devs app.sh
Never chmod 777
🔴777 means anyone, anywhere, can read/write/execute — it "fixes" a permission error by removing the security model entirely
🟠The real fix is almost always the correct owner or group, not wider permissions
🛡️
sudo & the sudoers File
Controlled privilege escalation — who can run what as root, logged and auditable.
Important
Important
/etc/sudoers (edit via visudo only)
sudoers
%devs ALL=(ALL) NOPASSWD: /usr/bin/systemctl restart billing-api
# group "devs" can restart exactly this service, no password
1
Always edit with visudo — it syntax-checks before saving, a broken sudoers file can lock everyone out
2
Scope rules to specific commands, not blanket ALL=(ALL) ALL, wherever possible
SetUID, SetGID & Sticky Bit
The three special permission bits that change how a file or directory behaves beyond plain rwx.
Advanced
Recommended
The Three Bits
🔵SetUID — executable runs as the file's owner, not the caller (e.g. passwd)
🔵SetGID — new files in a directory inherit the directory's group
🔵Sticky bit — only the file owner can delete, even with group write (e.g. /tmp)
Audit Command
find
find / -perm -4000 -type f 2>/dev/null
# list every SetUID binary — audit regularly
PACKAGE MANAGEMENT
How software actually gets onto a Linux box, and stays trustworthy
3 Concepts
📦
apt vs yum/dnf
The two package-manager families — Debian/Ubuntu vs RHEL/CentOS/Fedora — same job, different commands and package formats.
Must Know
Must Know
TaskDebian / Ubuntu (apt, .deb)RHEL / Fedora (dnf, .rpm)
Installapt install nginxdnf install nginx
Update indexapt updatednf check-update
Upgrade allapt upgradednf upgrade
Searchapt search nginxdnf search nginx
Removeapt remove nginxdnf remove nginx
🔑
Repository Management & GPG Keys
A repo tells the package manager where to look; a GPG key proves what it finds there hasn't been tampered with.
Important
Important
Adding a third-party repo safely
apt
curl -fsSL https://repo.example.com/key.gpg | gpg --dearmor -o /etc/apt/keyrings/example.gpg
echo "deb [signed-by=/etc/apt/keyrings/example.gpg] https://repo.example.com stable main" | tee /etc/apt/sources.list.d/example.list
apt update
🟠Never apt-get install --allow-unauthenticated in production — that's disabling the exact check that stops supply-chain attacks
🔨
Building from Source vs Packages
Sometimes the package repo doesn't have the version you need — knowing when compiling from source is actually the right call.
Decision
Recommended
Use Packages When
🟢A stable version exists in the repo — packages get security patches automatically
Build From Source When
1
You need a specific patch/version not yet packaged
2
Custom compile flags are required (e.g. hardware-specific optimizations)
3
Track it in config management — a hand-built binary nobody remembers building is a liability
PROCESS & SERVICE BASICS
Every running program is a process — here's how to see and control them
3 Concepts
📋
ps, top, and the Process Tree
Every process has a parent — understanding the tree is how you find what actually spawned that runaway job.
Must Know
Must Know
process inspection
ps aux --sort=-%cpu | head
ps -ef --forest # process tree view
pstree -p 1
top # or htop for the friendlier version
📡
Foreground/Background Jobs & Signals
Ctrl+C sends SIGINT. kill -9 sends SIGKILL. They are not the same thing, and using the wrong one has consequences.
Important
Important
Common Signals
🔵SIGTERM (15) — polite "please shut down," process can clean up
🔴SIGKILL (9) — immediate termination, no cleanup, last resort
🔵SIGHUP (1) — often used to tell a daemon "reload your config"
Job Control
1
ctrl+z suspends, bg resumes in background, fg brings back to foreground
2
nohup cmd & keeps a job alive after you log out
🔧
Starting Services (Intro to systemctl)
A first taste of systemd service control — the full deep-dive is in the Advanced issue, but you need this much on day one.
Basics
Recommended
systemctl
systemctl status nginx
systemctl restart nginx
systemctl enable nginx # start on boot
SHELL, SCRIPTING & TEXT PROCESSING
The tools that turn one-off commands into repeatable automation
3 Concepts
📜
Bash Scripting Basics
Variables, loops, and conditionals — the four constructs that turn a list of commands into an actual script.
Must Know
Must Know
backup.sh
bash
#!/usr/bin/env bash
set -euo pipefail
for f in /data/*.log; do
  if [[ -s "$f" ]]; then
    gzip "$f"
  fi
done
🟠set -euo pipefail at the top of every script — exit on error, undefined variable, or failed pipe. This alone prevents most silent script failures.
🔍
grep/sed/awk Essentials
The classic Unix text-processing trio — find it, transform it, extract it. Still the fastest way to slice a log file.
Important
Important
text processing
# grep — find lines matching a pattern
grep -i "error" /var/log/app.log
# sed — find & replace in place
sed -i 's/staging/production/g' config.yaml
# awk — extract & compute on columns
awk '{sum+=$5} END {print sum}' access.log
🔗
Pipes, Redirection & Environment Variables
How to chain commands together and control where their output goes — the connective tissue of everything above.
Fundamentals
Recommended
Redirection
🔵> overwrites, >> appends, 2>&1 merges stderr into stdout
🔵cmd1 | cmd2 — stdout of cmd1 becomes stdin of cmd2
Environment Variables
1
export VAR=value — makes it visible to child processes
2
.bashrc / .bash_profile — where persistent exports belong
Decision Guide

WHICH PACKAGE MANAGER AM I ON?

A quick lookup for jumping between distro families.

DistroFamilyPackage Manager
Ubuntu / DebianDebianapt (.deb packages)
RHEL / CentOS / Rocky / AlmaRed Hatdnf / yum (.rpm packages)
FedoraRed Hatdnf (.rpm packages)
Amazon Linux 2023Red Hat-baseddnf
AlpineIndependentapk

COMMAND CHEATSHEET

Filesystem
df -hT
du -sh * | sort -rh | head
findmnt
ln -s target link
Permissions
chmod 750 file
chown user:group file
visudo
id vishal
Packages
apt list --installed | grep nginx
dnf history
apt-cache policy nginx
Processes
ps aux --sort=-%mem | head
kill -15 PID
systemctl list-units --failed
Shell
grep -rn "TODO" .
history | grep ssh
chmod +x script.sh
General
man command
uname -a
uptime
VA
Vishal Abhinav
Platform Ops Engineer · Ops Newsletter — Issue #054