Mac & Terminal fixes, run on a real Mac before we publish.
Short, practical fixes for macOS, Terminal, Homebrew and developer tools. We run every command on a real Mac and paste the real output — so you know it works on current macOS before you try it. How we test →
- Developer Tools
How to Undo git add (Before Commit, Keep Changes)Undo git add with git restore --staged <file>, or git reset to unstage everything. Your edits stay. Tested on Mac, incl. repos with no commits yet.
- Terminal
How to Check MacBook Specs (Terminal + About This Mac)Run system_profiler SPHardwareDataType to see your MacBook's chip, cores, and RAM. One ioreg line also prints the model year. Tested on macOS Tahoe.
- Network
How to Check MAC Address on Mac (Terminal + Private Wi-Fi)Run networksetup -getmacaddress en0 for your Mac's real Wi-Fi MAC address. ifconfig shows the private one instead. Tested on macOS Tahoe.
- Performance
How to Clear Cache on Mac (Safely, with Terminal)Measure ~/Library/Caches with du, quit the app, then delete only its cache folder. Tested on macOS Tahoe: Homebrew, npm, pip, Chrome and the hidden cache.
- Terminal
How to Restart Mac from Terminal (shutdown -r now)Run sudo shutdown -r now to restart a Mac from Terminal. Tested on macOS Tahoe: shutdown timers, cancelling, the osascript way and why pmset can't restart.
- Terminal
How to Find a File on Mac Terminal by Name (find, mdfind)Run find . -name "file.txt" to search the current folder and subfolders, or mdfind -name to search the Spotlight index. Tested on macOS Tahoe with zsh.
- Terminal
How to Create a File in Terminal on Mac (touch, echo, cat)Run touch notes.txt to create an empty file in Mac Terminal, or echo "text" > file.txt to create one with content. Tested on macOS Tahoe with zsh.
- Developer Tools
How to Install Python on Mac with Homebrew (python3 + pip)Run brew install python to get the latest Python 3 on Mac. Tested: which version you get, why python3.12 has no python3 link, and the 3.9 system Python.
- Terminal
How to Check macOS Version in Terminal (sw_vers and More)Run sw_vers -productVersion to print your macOS version in Terminal. Tested on macOS Tahoe: build number, Darwin kernel, arm64 vs x86 and script-safe checks.
- Finder & Files
How to Open a Folder in Finder from Terminal on Mac (open .)Run open . to open the current Terminal folder in Finder, or open -R file to reveal a file. Tested on macOS Tahoe with spaces, symlinks and .app folders.
- Terminal
Timeout Command Not Found on Mac? 3 Ways to Fix ItmacOS has no timeout command. Install coreutils for gtimeout, or use perl -e 'alarm shift; exec @ARGV' 5 cmd with no install. Tested on macOS Tahoe.
- Developer Tools
How to Uninstall a Homebrew Package on Mac (and Its Dependencies)Run brew uninstall <name>, then brew autoremove to drop unused dependencies and brew cleanup --prune=all to clear the download cache. Tested on macOS Tahoe.
- 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.
- 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
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.
- 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.
- 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
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.
- 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.
- 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.
- 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.
- 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.
- 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.
More from suik.me
Other tools built by the same person — some are in Korean. All projects →
- Nalsem · 날셈 Korean age, date and lunar-calendar calculator: international vs. Korean age, D-day counts, solar–lunar conversion, zodiac signs and public holidays — 28 everyday calculations in one place. nalsem.suik.me ↗
- BizCheck · 거래처 지킴이 Early-warning alerts for Korean B2B customers. Upload a list of business registration numbers and get an email when one suspends or closes (National Tax Service) or its headcount drops sharply (National Pension data). bizcheck.suik.me ↗