DEV Community

loading...

Os X Cheat Sheet

hoanganhlam profile image Lâm ・2 min read

Useful utils

  • open - open files and directories (man)
  • textutil - manipulate text files of various formats (man)
  • pbcopy / pbpaste - provide copying and pasting to the pasteboard (man)
  • sips - scriptable image processing system (man)
  • mdfind - finds files matching a given query (man)
  • screencapture - capture images from the screen (man)
  • defaults - access the Mac OS X user defaults system (man)
  • /usr/libexec/airportd
  • scutil

INFO: brew (link) is highly recommended utility

System utils

  • networksetup - Configure network (ip, dns, proxy, etc)
  • tmutil - Configure Time Machine (enable/disable, exclude path, delete snapshots, etc)
  • mdutil - Manage Spotlight (enable/disable, exclude, etc)
  • diskutil - Control disk (format, eject, unmount, etc)
  • launchctl - Control running "agents"

Turn on/off proxy

sudo networksetup -setsocksfirewallproxystate Wi-Fi off
sudo networksetup -setsocksfirewallproxystate Ethernet off
sudo networksetup -setsocksfirewallproxy Wi-Fi 127.0.0.1 9999
sudo networksetup -setsocksfirewallproxy Ethernet 127.0.0.1 9999
sudo networksetup -setsocksfirewallproxystate Wi-Fi on
sudo networksetup -setsocksfirewallproxystate Ethernet on
Enter fullscreen mode Exit fullscreen mode




Disable spotlight indexing


mdutil -a -i off                    # disable indexing for all volumes
mdutil -i off MOUNT_POINT # disable for specific volume
touch FOLDER/.metadata_never_index # disable for FOLDER
Enter fullscreen mode Exit fullscreen mode




Flush DNS


killall -HUP mDNSResponder   # 10.8+
dscacheutil -flushcache # 10.7 below
Enter fullscreen mode Exit fullscreen mode




Auto-hide other windows on dock switch


defaults write com.apple.dock single-app -bool TRUE
killall Dock

defaults delete com.apple.dock single-app
killall Dock

Enter fullscreen mode Exit fullscreen mode




Hide desktop icons


defaults write com.apple.finder CreateDesktop -bool false
killall Finder
Enter fullscreen mode Exit fullscreen mode




Locations of startup items


~/Library/LaunchAgents
/System/Library/LaunchAgents/
/System/Library/LaunchDaemons/
/Library/LaunchAgents/
/Library/LaunchDaemons/

Running launchctl list show you what launch scripts are currently loaded.

Enter fullscreen mode Exit fullscreen mode




Reference

Discussion (0)

Forem Open with the Forem app