All guides
Developer Tools
- Developer Tools
Git Undo Last Commit (Keep Changes or Discard Them)Undo the last Git commit and keep your changes with git reset --soft HEAD~1. Tested reset modes, revert, amend, reflog recovery and pushed commits.
- Developer Tools
How to Generate an SSH Key on Mac and Add It to GitHubRun ssh-keygen -t ed25519 -C "you@example.com", save the passphrase in Keychain, copy the key with pbcopy and add it to GitHub. Tested on macOS 26.
Finder & Files
- Finder & Files
How to Find Large Files on Mac (Terminal and Finder)Find large files on a Mac with find ~ -xdev -type f -size +1G, or instantly with mdfind. Tested timings, du sizing, and what is safe to delete.
- Finder & Files
How to Show Hidden Files on Mac (Shortcut, Terminal, Permanent)Press Cmd+Shift+Period in Finder to show hidden files on Mac. Plus ls -a, the permanent defaults command, and chflags to hide or unhide any file.
Network
- Network
How to Flush DNS on Mac (macOS Tahoe 26 Command)Flush DNS on macOS Tahoe with: sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder. Then check it worked, and see when flushing won't help.
- Network
How to Kill a Process on a Port on Mac (Port Already in Use)Find what is using a port with lsof -nP -iTCP:8080 -sTCP:LISTEN, then kill it by PID. Plus why ports 5000 and 7000 are taken by AirPlay on macOS.
- Network
Mac Terminal Command to Find Your IP Address (Local & Public)Run ipconfig getifaddr en0 to get your Mac's local IP, and curl -4 -s https://ifconfig.me for your public IP. Tested on macOS Tahoe with real output.
Performance
- Performance
How to Check MacBook Battery Health and Cycle CountCheck MacBook battery health in System Settings > Battery, or run system_profiler SPPowerDataType for cycle count, condition and maximum capacity.
- Performance
How to Check RAM Usage on Mac in Terminal (What's Using It)See what is using RAM on a Mac with top -l 1 -o mem, memory_pressure and vm_stat. Tested on Apple Silicon, with swap, compression and GB conversion.
- Performance
Mac Terminal Command to Keep Screen On (caffeinate)Run caffeinate -d to keep your Mac's screen on until you press Ctrl+C, or caffeinate -d -t 3600 for one hour. Every flag tested on macOS Tahoe.
Terminal
- Terminal
Fix "zsh: command not found: brew" on Mac (also python, pip, npm)On Apple Silicon, Homebrew lives in /opt/homebrew/bin. Add eval "$(/opt/homebrew/bin/brew shellenv)" to ~/.zprofile. Fixes for python, pip, npm and code too.
- Terminal
How to Set an Environment Variable on Mac Permanently (zsh)Add export MY_VAR=value to ~/.zshrc (or ~/.zprofile for PATH), then run source ~/.zshrc. Tested on macOS Tahoe with zsh 5.9, plus the temporary way.