NETOps / Linux

Linux Field Guide.

Commands worth remembering, commands worth searching, and troubleshooting sequences that help answer the question that matters: what do I run next? Examples assume a typical modern Linux distribution; package names and service details can vary.

FILES / NAVIGATION

Find it. Inspect it. Change it.

The daily filesystem commands.

pwd
ls -lah
find /path -type f -iname '*name*' 2>/dev/null
grep -Rni 'text' /path 2>/dev/null
stat file.txt
du -sh * | sort -h

Useful habit: inspect before modifying. ls -lah, stat and du answer a surprising number of questions.

PERMISSIONS

Who can do what?

Ownership, modes and privilege.

ls -l file
id
chmod 644 file
chmod 755 script.sh
sudo chown user:group file
Avoid reflexively using chmod 777. Determine the required owner/group and minimum permissions instead.
PROCESSES

What is actually running?

Find resource use and process ownership.

ps aux --sort=-%cpu | head
ps aux --sort=-%mem | head
pgrep -af process-name
top
kill PID

Use normal termination first. Escalating immediately to kill -9 prevents the process from cleaning up.

SYSTEMD / SERVICES

Service lifecycle.

Status before restart.

systemctl status service --no-pager
systemctl --failed
sudo systemctl restart service
sudo systemctl enable --now service
systemctl list-units --type=service --state=running
LOGS

Ask the machine what happened.

Recent events are usually more useful than guessing.

journalctl -p warning..alert -b --no-pager
journalctl -u service -n 100 --no-pager
journalctl -u service -f
dmesg --level=err,warn | tail -50

-b limits the journal to the current boot. -f follows new entries live.

NETWORK

Address → route → DNS → service.

Work through layers instead of randomly changing settings.

ip -br address
ip route
ss -tulpn
resolvectl status
curl -I https://example.com
ip route get 1.1.1.1
STORAGE / MEMORY

Where did the space go?

Capacity, devices, mounts and memory.

df -hT
df -ih
lsblk -f
findmnt
free -h
sudo du -xhd1 / 2>/dev/null | sort -h
SSH

Remote access.

Connect, copy and diagnose.

ssh user@host
ssh -vvv user@host
ssh-keygen -t ed25519
ssh-copy-id user@host
rsync -avh --progress source/ user@host:/path/

-vvv exposes where SSH negotiation is failing: resolution, connection, key selection or authentication.

PACKAGES

Install and update deliberately.

Common Debian/Ubuntu and Fedora/RHEL-family patterns.

sudo apt update && apt list --upgradable
apt search package
sudo apt install package
dnf search package
sudo dnf install package
WHAT DO I RUN WHEN…

A service is broken.

A reusable troubleshooting sequence.

Confirm the symptom and exact error. Do not start by restarting everything.
Run systemctl status service and note exit state or recent errors.
Read journalctl -u service -n 100.
Confirm the expected port with ss -tulpn.
Check disk/memory with df -h and free -h.
Test locally before testing remotely.
Only then change configuration or restart.
WHAT DO I RUN WHEN…

The network is broken.

Isolate the failing layer.

ip -br address — do I have the expected address?
ip route — do I have a default route?
Test the local gateway.
Test a known external IP to separate routing from DNS.
Check resolver state with resolvectl status.
Test the actual application endpoint with curl -v.
Inspect listening sockets/firewall only after identifying which side is failing.
SYSTEM SNAPSHOT

What machine am I on?

Fast context before deeper work.

hostnamectl
uname -a
cat /etc/os-release
uptime
lscpu
free -h