all commands

Find the Linux command that matches the problem.

Browse 285 safety-rated command fixes. Start with read-only checks when you are unsure, and slow down when a command changes state or can expose sensitive output.

285 commands

Command library

Web Server Rescue Read-only
Read-only

Your Site Is Not Down. DNS Might Be Lying.

The browser said the site was gone. The server was answering fine.

curl --resolve example.com:443:203.0.113.10 https://example.com/
Linux Survival Basics Can be slow
Read-only Can be slow

Find the Files Eating Your Disk

The disk was full, but guessing at folders was the slow part.

find /var -type f -printf '%s %p\n' | sort -nr | head -20
Linux Survival Basics Can be slow
Read-only Can be slow

Watch Logs Without Opening the Whole File

The app was failing now. Opening a giant log file was the wrong move.

tail -n 80 -f /var/log/nginx/error.log
Linux Survival Basics Can be slow
Read-only Can be slow

Find Errors Before Reading Every Log Line

The error was in the log. The problem was finding it without reading noise.

grep -iE 'error|failed|denied|timeout' /var/log/nginx/error.log | tail -40
Web Server Rescue Can be slow
Read-only Can be slow

Check What Is Actually Listening

The app was running. The port was not listening.

ss -tulpn | grep ':80\|:443'
Linux Survival Basics Can be slow
Read-only Can be slow

Find the Exact Log Line Before You Scroll

The error was there. The useful part was knowing exactly where it was.

grep -inE 'error|failed|denied|timeout' /var/log/nginx/error.log
Linux Survival Basics Can be slow
Read-only Can be slow

Find Which Folder Is Filling the Disk

The disk was full. The fastest clue was the folder, not the file.

du -sh /var/* 2>/dev/null | sort -h
Linux Survival Basics Can be slow
Read-only Can be slow

Show Only Recent Errors

The log had old failures too. I only cared about the newest ones.

grep -iE 'error|failed|denied|timeout' /var/log/nginx/error.log | tail -10
Dangerous Commands Dry run

Preview What Rsync Would Delete

`rsync --delete` is useful. It is also how people erase the wrong side.

rsync -avhn --delete ./source/ ./backup/ | grep '^deleting'
Linux Survival Basics Read-only
Read-only

Check Owner and Mode in One Line

The file existed. The owner and mode explained why it still failed.

stat -c '%A %U:%G %n' /var/www/example/index.html
Linux Survival Basics Can be slow
Read-only Can be slow

Find the Processes Using Memory

The server felt slow. Memory pressure was the first thing to rule out.

ps -eo pid,comm,%mem,%cpu --sort=-%mem | head
Linux Survival Basics Can be slow
Read-only Can be slow

Show Big Files in Human Units

Byte counts are precise. Human units are faster under pressure.

find /var -type f -printf '%s %p\n' | sort -nr | head -10 | awk '{printf "%.1f MB %s\n", $1/1024/1024, $2}'
Apple Terminal Can be slow
Read-only Can be slow

Find What Is Using a Local Dev Port

Your dev server says port 3000 is busy. Ask macOS who is holding it.

lsof -nP -iTCP:3000 -sTCP:LISTEN
Apple Terminal Read-only
Read-only

Show Your PATH One Entry Per Line

Wrong Node, Python, or FFmpeg? Start by reading your PATH clearly.

echo "$PATH" | tr ':' '\n' | nl -ba
Apple Terminal Can be slow
Read-only Can be slow

Find Large Files Inside a Project

Before committing, check whether a huge video, build artifact, or export slipped into your repo.

find . -type f -size +100M -print
Apple Terminal Can be slow
Read-only Can be slow

Find Which Folder Is Eating Disk Space

When your Mac is full, start with the biggest folders in the current directory.

du -sh ./* 2>/dev/null | sort -h
Apple Terminal Stops processes
Changes state

Flush macOS DNS Cache

Changed DNS but your Mac still visits the old place? Flush the resolver cache.

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
Apple Terminal Can be slow
Read-only Can be slow

Watch a Log or Build File Update

Need to see whether a file is still changing? Let tail follow it live.

tail -f ./app.log
Apple Terminal Can be slow
Read-only Can be slow

Search a Log for Errors With Context

A wall of logs is useless until you pull the error and the lines around it.

grep -n -C 2 'ERROR' ./app.log