Osx Cheat Sheet

From WikiOD

Here is the cheatsheat of Osx and basic guide on how to use Osx

Locations of startup items[edit | edit source]

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

__Running `launchctl list` show you what launch scripts are currently loaded.__

Hide desktop icons[edit | edit source]

defaults write com.apple.finder CreateDesktop -bool false
killall Finder

Auto-hide other windows on dock switch[edit | edit source]

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

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

Flush DNS[edit | edit source]

killall -HUP mDNSResponder   # 10.8+
dscacheutil -flushcache      # 10.7 below

Disable spotlight indexing[edit | edit source]

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
                                    

Turn on/off proxy[edit | edit source]

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

System utils[edit | edit source]

  • 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”

Useful utils[edit | edit source]

  • 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

Credit:rstacruz