$ ./mactechbuds.sh
Starting MacTechBuds...
Blog engine loaded ✓
AI tools ready ✓
Bash scripts active ✓
Timer system ready ✓
Theme engine active ✓
Dev tools online ✓
mactechbuds.com >
Back to Tech Thoughts

Terminal Tips & Tricks for macOS

Overview

A curated set of Terminal tips, aliases, and commands to boost your daily macOS workflow. Covers Zsh configuration, useful one-liners, and admin shortcuts.

Zsh Config Tips

Useful Aliases for ~/.zshrc

zsh
# Shortcuts
alias ll='ls -lah'
alias reload='source ~/.zshrc'
alias ip='curl -s ifconfig.me'
alias flushdns='sudo dscacheutil -flushcache && sudo killall -HUP mDNSResponder'
alias cleanup='find . -name ".DS_Store" -delete'

# macOS version quick check
alias osver='sw_vers'

Handy One-Liners

Find Large Files

bash
# Files larger than 1GB
find / -size +1G -type f 2>/dev/null

# Show top 20 disk hogs in current dir
du -sh * | sort -rh | head -20

Network Diagnostics

bash
# Show listening ports
lsof -i -P -n | grep LISTEN

# Check DNS resolution
dig +short google.com @8.8.8.8

# Network interface info
ifconfig en0

Keyboard Shortcuts in Terminal

Ctrl+A — Jump to beginning of line
Ctrl+E — Jump to end of line
Ctrl+R — Search command history
Ctrl+L — Clear screen
Option+Click — Move cursor to click position