Rreact.wiki
← Blog

I Paid $4 for a Mac App. Then I Found the One Terminal Command It Was Running.

I Paid $4 for a Mac App. Then I Found the One Terminal Command It Was Running.

How macOS’s “$4 app → one-line command” pattern reveals a deeper truth about interface design: minimal viable interfaces aren’t just lightweight—they’re composable, stateless, and free of abstraction tax—exactly what React encourages at its core.

17 Mac Terminal commands that replace paid utilities, bypass buried system settings, and cut through three-click menus — most of which I use every week.

Last year I spent ¥30 (~$4) on an App Store app that did exactly one thing: hide my desktop icons before a screen share. One button. That was the entire product.

A few weeks later I was browsing a Terminal config file and found this:

Bash
defaults write com.apple.finder CreateDesktop false; killall Finder

I stared at it for a full ten seconds. That was the app. One line. I had paid four dollars for a button that ran a single shell command.

That sent me down a rabbit hole: how many Mac apps are just a GUI shell around a Terminal command the developer assumed you wouldn't want to type?

The answer: more than I expected.

What follows are the 17 Terminal commands I actually use — most weekly, a few daily. Not party tricks. Commands that have replaced paid utilities, bypassed settings buried three menus deep, and saved me from ever opening "About This Mac → Storage" and waiting for that progress bar again.

Here's the overview:

TSX
┌────────────────────────────────────────────────────────────┐
17 Mac Terminal Commands — At a Glance         │
├──────────────────┬──────────────────┬──────────────────────┤
│  ⏰ Power        │  📋 Clipboard    │  💻 System Info      │
│  caffeinate      │  pbcopy/pbpaste  │  df -h               │
│  pmset           │                  │  uptime              │
│                  │                  │  battery query       │
├──────────────────┼──────────────────┼──────────────────────┤
│  🌐 Network      │  🎨 UI Tweaks   │  🔍 File Search      │
DNS flush       │  Hide desktop    │  mdfind              │
│  wdutil          │  Screenshot path │  mdls                │
│  Public IP check │  Dock magnify    │                      │
│                  │  Dialog expand   │                      │
├──────────────────┴──────────────────┴──────────────────────┤
│  🔐 Local password gen  |  🔊 Text-to-speech (say)         │
└────────────────────────────────────────────────────────────┘

Let's go through them.


1. Power Management: Stop Your Mac From Sleeping at the Worst Moment

caffeinate — Keep it awake during long tasks

You step away while a render or download is running. You come back and your Mac is asleep. The task is dead.

Bash
caffeinate

Hit enter. Your Mac won't auto-sleep until you Ctrl+C out. Need it timed?

Bash
caffeinate -d -t 3600   # Stay awake for 1 hour; -d also prevents the screen from dimming

I aliased this: alias cf='caffeinate -d' — two characters and it's running.

pmset — Find out what's keeping your Mac awake

Lid closed. Fan still spinning. Something is telling macOS not to sleep. This tells you what:

Bash
pmset -g assertions

Scroll to the bottom. Look for PreventSystemSleep or PreventUserIdleSystemSleep — the offending process is named right there. For me it's almost always a backup app that didn't close cleanly, or a video player I forgot to quit.


2. Clipboard Superpowers: pbcopy and pbpaste

These are the most underrated commands on a Mac. Once you start using them, you'll find yourself appending | pbcopy to almost everything out of habit.

pbcopy sends stdin into your clipboard. pbpaste reads it back out.

Bash
pwd | pbcopy              # Current directory path, straight to clipboard — no mouse, no selecting
cat ~/.zshrc | pbcopy     # Your entire config file, ready to paste anywhere
pbpaste | wc -w           # Count words currently in your clipboard

The use case that hooked me: I needed to paste my current working directory path into a Slack message mid-call. pwd | pbcopy, then paste. No mouse, no highlighting, no accidentally grabbing extra whitespace.


3. System Info: Skip the Spinner

df -h — Disk space without the 15-second wait

Mac says "storage almost full." You click About This Mac → Storage. The progress bar loads. And loads.

Bash
df -h

Every disk, every partition. Used / available / total / percentage, in human-readable units. Instant. No spinner.

(-h = human-readable. Drop it and you get raw bytes. Nobody needs raw bytes.)

uptime — How long since the last reboot

Bash
uptime

Shows when you last restarted and your system load averages. My Mac regularly runs 30+ days without a reboot. I don't recommend going past a week — clearing accumulated memory and running pending updates is worth the 90-second restart.

Battery health — The command to run before selling your Mac

Buyers always ask about cycle count. Apple buries it three menus deep. One command:

Bash
system_profiler SPPowerDataType | grep -E "Cycle Count|Maximum Capacity|Condition|State of Charge"

Sample output:

TSX
Cycle Count: 342
Maximum Capacity: 91%
Condition: Normal
State of Charge (%): 78

If Condition shows Service Recommended, replace the battery before listing — you'll get meaningfully more for it. Cycle count over 1,000 with capacity under 80% will drag your resale price down.


4. Network Debugging: Three Commands Worth Memorizing

DNS flush — First thing to try when a site won't load for you but works for everyone else

That specific frustration: a site is clearly up, you can reach it from your phone, but it's blank on your Mac.

DNS translates domain names to IP addresses, and macOS caches those translations locally. When the cache goes stale or corrupt, you get the "works for everyone else" problem.

Bash
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

No output = success. Refresh the page. Fixes it nine times out of ten.

wdutil — Wi-Fi diagnostics on macOS Sonoma and later

Most tutorials still tell you to use airport -I. Sonoma removed the airport binary. Run it now and you get command not found.

The replacement:

Bash
sudo wdutil info

SSID, channel, signal strength (RSSI), noise floor, MAC address, encryption type — all in one screen.

The number to watch is RSSI. Closer to zero = stronger:

TSX
RSSI > -60 dBm      → Strong ✅
-60 to -70 dBm      → Acceptable
-70 to -80 dBm      → Dropping packets — you'll feel it
Below -80 dBm       → Praying for packets 💀

Check your real public IP — Verify your VPN is actually doing something

Bash
curl ifconfig.me
# or
dig +short myip.opendns.com @resolver1.opendns.com

The second one queries OpenDNS directly, bypassing the HTTP layer. If the two return different IPs, trust the dig result.

Connected to VPN and want to confirm traffic is going through it? Run this, check the IP's location. Takes two seconds.


5. UI Tweaks: Hidden Mac Settings With No Toggle

These are settings Apple built in but never put a checkbox for anywhere in System Settings.

Hide desktop icons before screen sharing

Screen share about to start. Desktop covered in screenshots and half-finished files. Awkward.

Bash
# Hide
defaults write com.apple.finder CreateDesktop false; killall Finder
 
# Show again
defaults write com.apple.finder CreateDesktop true; killall Finder

This is the command that was inside the $4 app I bought. I've since wrapped both into Automator Quick Actions so I can trigger them without opening Terminal. Zero friction before any call.

Change where screenshots save by default

Bash
mkdir -p ~/Pictures/Screenshots
defaults write com.apple.screencapture location ~/Pictures/Screenshots
killall SystemUIServer

No more screenshot pileup on the desktop. Swap the path back to ~/Desktop any time.

Unlock the Dock's magnification limit

System Settings caps Dock magnification at 128px. Terminal doesn't care about that cap:

Bash
defaults write com.apple.dock largesize -int 256; killall Dock

Try 512 for the full absurd effect — your icons will be larger than your palm. (Magnification must be enabled in System Settings → Desktop & Dock first.)

Reset to default: defaults delete com.apple.dock largesize; killall Dock

Make save and print dialogs stay expanded — permanently

Every time you save a file, that collapsed little dialog appears and you click the arrow to expand it. Dozens of times a day, every day.

Bash
defaults write -g NSNavPanelExpandedStateForSaveMode -bool true
defaults write -g NSNavPanelExpandedStateForSaveMode2 -bool true
defaults write -g PMPrintingExpandedStateForPrint -bool true
defaults write -g PMPrintingExpandedStateForPrint2 -bool true

Run once, restart, and every app's save and print dialogs open expanded from that point on. The -g flag makes it global — it applies system-wide.

What's telling about this setting: within a few days you'll forget you ran it. You'll just notice that saving files feels strangely frictionless.


6. File Search: Faster Than Spotlight, and Pipeable

mdfind — Command-line Spotlight with pipeline support

Bash
mdfind "kind:pdf invoice"             # All PDFs mentioning "invoice"
mdfind -onlyin ~/Documents "contract" # Search only inside Documents
mdfind -name "report.docx"            # Search by filename

It uses Spotlight's already-built index, so it's far faster than find. The real value: results pipe directly to other commands.

Bash
mdfind "kind:pdf invoice" | xargs open   # Find and open every match immediately

mdls — See all of a file's hidden metadata

Cmd+I gives you the basics. mdls gives you everything:

Bash
mdls /path/to/file

EXIF data for images, document authors, creation dates — and the one that surprises people most:

Bash
mdls -name kMDItemWhereFroms ~/Downloads/some-file.zip

This returns the URL the file was downloaded from. macOS has been quietly logging the origin URL of every downloaded file. It's been there the entire time. Simultaneously very useful and mildly unsettling.


7. Two Extras Worth Having

Generate a strong password locally — no website, no extension

Bash
LC_ALL=C tr -dc 'A-Za-z0-9!@#$%^&*' </dev/urandom | head -c 20; echo

Pure local entropy. No server, no third party. Append | pbcopy (from section 2) to send it straight to your clipboard.

The LC_ALL=C prefix is non-optional — without it, macOS's tr will error on non-ASCII bytes from /dev/urandom. Most tutorials online skip this, which is why you copy them and they don't run. Now you know the fix before you need it.

say — Make your Mac announce when long tasks finish

Bash
say "Done, you can go get lunch"
say -v Samantha "Task complete"

Add say "Done" as the last line of any long-running script. Instead of glancing at Terminal every few minutes, you'll hear it finish from the other room.


What These Commands Have Actually Replaced in My Setup

TSX
Local password generator    → Replaced a $3 menu bar utility
Desktop icon toggle         → Replaced the $4 one-button app I mentioned
DNS flush                   → Replaced a "system optimizer" (that wanted full disk access)
caffeinate                  → Replaced a "keep awake" menu bar app

The pattern: if a Mac app does exactly one thing and that thing involves system settings — there's probably a Terminal command doing the actual work behind the button.

Before you buy the next single-purpose Mac utility, spend five minutes in Terminal first.