Useful built-in macOS command-line utilities
Enhanced use of open and Finder integration
open -nlaunches a new instance of an app (e.g., Preview) to view the same file twice.open -a <App> <file>,open -b <bundle_id> <file>, andopen -R <file>let you target non-default apps, use stable bundle IDs, or reveal files in Finder.open .(oropen -a Finder .) opens the current directory in Finder.- Some note
opensometimes brings apps to foreground; others point to-gfor background and possible links to Terminal’s “secure keyboard entry.” - Finder path tricks: drag proxy icons into Terminal, copy a file in Finder then paste its path into Terminal, or use AppleScript to
cdinto the frontmost Finder window.
Sleep, power, and battery management
caffeinateis widely praised (-disu,-w <pid>, wrapping long-running commands). Some say it doesn’t keep chat apps “active” even with-u.- GUI alternatives like Amphetamine and KeepingYouAwake are mentioned.
pmsetandpowermetricsare used for power settings and diagnosing battery drain, sometimes combined withcaffeinate. Reliability of scheduled wake is described as mixed.
Media and file format tools
sipsis used for batch image conversion and resizing; can convert from (but not to) WebP. It hides a JS/Canvas-like API.afconvertandafplayhandle audio conversion/playback, with repeated claims that Apple’s AAC encoder is higher quality than many others.- Long subthread debates AAC vs MP3 vs Opus/FLAC, encoder quality, and psychoacoustic models, with some preferring Opus/FLAC and others emphasizing AAC’s compatibility and quality.
sayis used for notifications, pranks, scripting voiceovers, and has quirks (roman numerals, custom voices).hearis mentioned as a third-party speech-recognition CLI.
Clipboard and JSON/text utilities
pbcopy/pbpasteare heavily used; people mirror them on Linux/WSL and via OSC52 for remote sessions.- A common pattern:
pbpaste | jq | pbcopyto pretty-print JSON. - Cross-platform helper functions abstract differences between macOS and Linux clipboards.
Search, metadata, and indexing
mdfindis preferred overlocate(not enabled by default), sometimes aliased to matchlocatebehavior.- Example pattern: embedding unique IDs in files and using
mdfind+ hashes to rediscover directories. mdlsis used to inspect file metadata (e.g., photo GPS data).plutilconverts and queries plist files and can parse JSON, though some say built-injq(macOS 15+) supersedes parts of this.
Networking and diagnostics
- Hidden
airport -sscans Wi‑Fi; users note it is deprecated in favor ofwdutil. Capability parity (e.g., monitor mode) withairportis unclear. networkQualityruns bandwidth/latency tests. Some find it underestimates uplink vs other tools;-sflag gives more comparable sequential tests.- Other mentioned tools:
nc(netcat),fs_usage(I/O tracing),system_profiler,wdutil, and third-party Bluetooth diagnostics gaps.
Filesystem, backup, and storage tools
diskutilis praised as more reliable than Disk Utility GUI.pdiskis called obsolete except for legacy Apple Partition Map.tmutilis cited for Time Machine control.- Debates around APFS complexity, Time Machine regressions, and Apple’s focus shifting toward iCloud.
- Some recommend
dot_clean -mfor cleaning metadata files from USB drives.
UI tweaks and defaults
defaults writeis used to tweak many macOS settings; example: changing Launchpad grid size then restarting Dock.- Tools like TinkerTool provide a GUI over hidden defaults.
- Terminal.app’s “New Remote Connection…” and Finder’s show-hidden-files toggle (Shift+Cmd+.) are highlighted as underused UI features.
Keychain, security, and passwords
- The
securityCLI is appreciated for Keychain access, but one commenter warns of “sharp edges” vs using password managers with their own CLIs; specifics of those issues are not elaborated. - Lack of a CLI for iCloud Keychain-stored passwords is seen as a missing piece for scripting secrets.
Cross-platform parallels and third‑party CLIs
- Linux parallels:
xdg-open,caffeine/caffeinatepackages, clipboard shims on WSL. - Popular non-built-in tools mentioned:
fzf,ripgrep,lsd,atuin,mtr, httpie, various Mac-specific lists (Terminal Trove, personal catalogs).
Debates, annoyances, and meta points
.DS_Storesparks debate: some see it as ugly clutter or even a “bug”; others defend it as necessary, portable metadata, with alternatives (xattrs, central DB) having tradeoffs.- Complaints about apps hijacking file associations (e.g., JSON to Xcode, directories to VSCode on Linux).
- Critique that some modern Apple utilities rewrites (often in Swift) feel slower/buggier; others argue the causes may be broader than language choice.
- Some commentary on terminology: these tools are Unix utilities, not “bash commands.”