Skip to content


Apple's Unix desktop operating system.

Useful Commands

  • caffeinate
  • mdutil
  • networksetup
  • scutil
  • serverinfo
  • sharing
  • tccutil

Logout user from a shell

sudo launchctl bootout gui/$(id -u "$USERNAME")


sudo launchctl bootout user/$(id -u "$USERNAME")

Show hardware info

system_profiler SPHardwareDataType

Install package from CLI

Use for most things. Otherwise:

sudo installer -pkg /Volumes/ExifTool-9.16/ExifTool-9.16.pkg -target /

Start FTP server

sudo -s launchctl load -w /System/Library/LaunchDaemons/ftp.plist

Check swap usage

sysctl vm.swapusage

Disable wifi disconnect when locking screen

sudo /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources airport en1 prefs DisconnectOnLogout=NO

Show some downloaded files

This shows a list of all the quarantine checked downloads:

sqlite3 ~/Library/Preferences/* 'select distinct LSQuarantineDataURLString from LSQuarantineEvent'

Send Notifications from Terminal

sudo gem install terminal-notifier
terminal-notifier -message "Hello, this is my message" -title "Message Title"

Enable verbose eap logging

sudo defaults write /Library/Preferences/SystemConfiguration/ LogFlags -int -1


  • gif0 - Generic Tunnel Interface. See man gif.
  • stf0 - Six To Four tunnel. See man stf.

Migration Assistant

Some files are not migrated using Migration Assistant. EG:

  • /etc/hosts
  • crontabs
  • /etc/apache2/httpd.conf

Remap caps-lock to escape

This remaps using a different mechanism than what the Keyboard pref pane uses, so the change will not be reflected there, so you will want to make sure to save both of these functions so you can reset when you need normal behavior.

    hidutil property --set \

    hidutil property --set '{"UserKeyMapping":[]}'