← Back to blog

macOS (Apple)

Productivity

Coding

Video and graphics

System and file repair

  • diskutil verifyVolume /
  • diskutil repairVolume /
  • sudo periodic daily weekly monthly
  • killall AppName

Repairing the boot volume typically requires starting up in macOS Recovery.

Network and connectivity

  • sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
  • sudo ipconfig set en0 DHCP
  • ping google.com

The interface name (en0) can vary. Check System Settings > Network or run ifconfig to confirm yours.

System information

  • system_profiler SPSoftwareDataType
  • system_profiler SPHardwareDataType | grep "Serial Number"

Advanced tools

  • Storage Management (GUI): Apple menu > About This Mac > More Info > Storage > Manage
  • sudo shutdown -r now

Application administration

Clear terminal history

  • cat /dev/null > ~/.zsh_history && history -c && exit

Clear Homebrew and App Store caches

  • brew cleanup
  • brew autoremove
  • rm -rf ~/Library/Caches/Homebrew/*
  • brew update
  • brew upgrade
  • sudo softwareupdate -l
  • mas upgrade

mas (Mac App Store CLI) requires separate installation via brew install mas.

Firewall

Manage the firewall through System Settings.

  • Open System Settings → Network → Firewall
  • Toggle the firewall on or off, and click Options for per-app rules
  • Allow a specific app: Firewall → Options → add the app and set it to allow incoming connections

Copying files via terminal

  • cp file.txt ~/Backup/
  • rsync -av Source/ Destination/
  • scp file.txt user@host:/path/

Disk usage and storage

  • Apple menu → About This Mac → More Info → Storage for an overview per category
  • df -h for total and free space per volume
  • du -sh * to see folder sizes in the current directory

Scheduled tasks

  • launchd manages scheduled jobs via plist files in ~/Library/LaunchAgents (user) or /Library/LaunchDaemons (system)
  • crontab -e for traditional cron-style scheduling

Compression and archiving

  • Right-click a file or folder → Compress
  • zip -r archive.zip folder/ and unzip archive.zip
  • tar -czvf archive.tar.gz folder/ and tar -xzvf archive.tar.gz

History

  • 1976

    Steve Jobs, Steve Wozniak, and Ronald Wayne found Apple.

  • 1984

    The original Macintosh launches with one of the first mass-market graphical user interfaces.

  • 1985

    Jobs leaves Apple after an internal power struggle.

  • 1996

    Apple acquires NeXT, bringing Jobs back and providing the NeXTSTEP foundation for what becomes Mac OS X.

  • 2001

    Mac OS X 10.0 "Cheetah" replaces the classic Mac OS with a Unix-based system.

  • 2012

    "Mac OS X" is shortened to "OS X" starting with OS X Mountain Lion.

  • 2016

    The operating system is renamed "macOS" starting with macOS Sierra.

  • 2020

    Apple begins transitioning Macs from Intel processors to its own Apple Silicon chips, starting with the M1.