Skip to content

macOS Power User Tips & Tricks

macOS Power User Tips

Collection of useful macOS command-line tricks and productivity tips for developers and system administrators. These commands leverage macOS's built-in tools and Unix foundation for enhanced workflow efficiency.

Terminal Prerequisites

Most commands require Terminal.app or your preferred terminal emulator. Some commands may need Homebrew for additional tools like jq.

Clipboard Operations

JSON Formatting

Perfect for developers working with APIs and JSON data:

Beautify JSON from Clipboard
pbpaste | jq | pbcopy  #(1)!
  1. Takes JSON from clipboard, formats it with jq, and copies back to clipboard

jq Installation

Install jq via Homebrew: brew install jq

File to Clipboard

Copy File Contents
cat <file> | pbcopy  #(1)!
pbcopy < file        #(2)!
  1. Reads file contents and copies to system clipboard
  2. Alternative using input redirection (more efficient)

Usage Examples

pbcopy < ~/.ssh/id_rsa.pub    # Copy SSH public key
pbcopy < README.md            # Copy markdown file
ls -la | pbcopy               # Copy directory listing

System Monitoring

Thermal Information

Monitor your Mac's thermal state and temperature sensors:

Complete Thermal Report
sudo powermetrics -s thermal  #(1)!
  1. Shows comprehensive thermal data including CPU temperature, fan speeds, and thermal pressure
Thermal Summary
sudo powermetrics -s thermal | grep -A2 -i thermal  #(1)!
  1. Shows only thermal-related lines with 2 lines of context for easier reading

Admin Privileges Required

The powermetrics command requires sudo privileges to access hardware sensors.

Advanced System Information

CPU and Performance Metrics

CPU Performance Data
sudo powermetrics -s cpu_power  #(1)!
sudo powermetrics -s smc        #(2)!
  1. Displays CPU power consumption and performance states
  2. Shows System Management Controller data including voltages and currents

Memory and Disk Information

System Resource Overview
vm_stat  #(1)!
df -h    #(2)!
top -l 1 -s 0 | grep PhysMem  #(3)!
  1. Display virtual memory statistics
  2. Show disk space usage in human-readable format
  3. Quick memory usage summary

Network Utilities

Network Configuration

Network Information
ifconfig  #(1)!
netstat -rn  #(2)!
lsof -i  #(3)!
  1. Display network interface configuration
  2. Show routing table
  3. List open network connections

Wi-Fi Management

Wi-Fi Commands
networksetup -listallhardwareports  #(1)!
airport -s  #(2)!
  1. List all network hardware ports
  2. Scan for available Wi-Fi networks (requires airport utility)

Application Management

Process Management

Process Operations
ps aux | grep <process_name>  #(1)!
pkill -f <process_name>       #(2)!
launchctl list               #(3)!
  1. Find running processes by name
  2. Kill processes by name pattern
  3. List all launch services

Application Information

App Details
system_profiler SPApplicationsDataType  #(1)!
mdfind "kMDItemKind == 'Application'"   #(2)!
  1. Detailed information about installed applications
  2. Find all applications using Spotlight metadata

Security and Privacy

File Permissions and Attributes

File Security
ls -la@  #(1)!
xattr -l <file>  #(2)!
codesign -dv --verbose=4 <app>  #(3)!
  1. List files with extended attributes
  2. Display extended attributes for specific file
  3. Verify code signature of applications

System Integrity Protection

SIP Status
csrutil status  #(1)!
  1. Check System Integrity Protection status

Development Tools

Xcode Command Line Tools

Developer Tools
xcode-select --print-path  #(1)!
xcode-select --install     #(2)!
xcrun --show-sdk-path      #(3)!
  1. Show current developer directory path
  2. Install Xcode command line tools
  3. Display SDK path for development

Package Management

Homebrew Essentials
brew list                    #(1)!
brew outdated               #(2)!
brew cleanup               #(3)!
  1. List installed Homebrew packages
  2. Show packages with available updates
  3. Clean up old package versions

Performance and Optimization

Disk Usage Analysis

Storage Analysis
du -sh ~/Desktop ~/Documents ~/Downloads  #(1)!
ncdu ~                                    #(2)!
  1. Check size of common user directories
  2. Interactive disk usage analyzer (install via brew install ncdu)

Cache Management

Clear System Caches
sudo dscacheutil -flushcache  #(1)!
sudo killall -HUP mDNSResponder  #(2)!
  1. Flush DNS cache
  2. Restart mDNS responder for network discovery

Additional Resources

Useful Tools to Install

Recommended Homebrew Packages
brew install jq htop tree ncdu wget curl git
  • jq - JSON processor
  • htop - Interactive process viewer
  • tree - Directory structure visualization
  • ncdu - Disk usage analyzer
  • wget/curl - Download utilities