cheatsheets/osx.md

71 lines
2.9 KiB
Markdown
Raw Permalink Normal View History

2013-10-14 02:36:58 +00:00
---
title: OS X
2018-12-06 22:15:40 +00:00
category: macOS
2013-10-14 02:36:58 +00:00
---
2013-01-24 21:04:38 +00:00
### Locations of startup items
2012-03-16 06:14:31 +00:00
2018-03-15 09:43:14 +00:00
~/Library/LaunchAgents
2012-03-16 06:14:31 +00:00
/System/Library/LaunchAgents/
/System/Library/LaunchDaemons/
/Library/LaunchAgents/
/Library/LaunchDaemons/
2017-11-09 01:10:12 +00:00
2018-03-15 09:43:14 +00:00
__Running `launchctl list` show you what launch scripts are currently loaded.__
2012-03-16 06:14:31 +00:00
2013-01-24 21:04:38 +00:00
### Hide desktop icons
2012-03-16 06:14:31 +00:00
defaults write com.apple.finder CreateDesktop -bool false
killall Finder
2013-01-24 21:04:38 +00:00
### Auto-hide other windows on dock switch
2012-03-16 06:14:31 +00:00
defaults write com.apple.dock single-app -bool TRUE
killall Dock
defaults delete com.apple.dock single-app
killall Dock
2013-01-24 21:04:38 +00:00
### Flush DNS
2012-03-17 17:17:39 +00:00
2013-01-24 21:04:38 +00:00
killall -HUP mDNSResponder # 10.8+
dscacheutil -flushcache # 10.7 below
2012-03-17 17:17:39 +00:00
### Disable spotlight indexing
2013-01-24 21:04:38 +00:00
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
2017-11-09 01:10:12 +00:00
### 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
### 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)
2018-06-14 15:48:42 +00:00
- `diskutil` - Control disk (format, eject, unmount, etc)
- `launchctl` - Control running "agents"
2017-11-09 01:10:12 +00:00
2018-03-15 09:43:14 +00:00
### Useful utils
2017-11-09 01:10:12 +00:00
2018-01-31 21:38:24 +00:00
- `open` - open files and directories ([man](https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/open.1.html))
- `textutil` - manipulate text files of various formats ([man](https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/textutil.1.html))
- `pbcopy` / `pbpaste` - provide copying and pasting to the pasteboard ([man](https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/pbcopy.1.html))
- `sips` - scriptable image processing system ([man](https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/sips.1.html))
- `mdfind` - finds files matching a given query ([man](https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/mdfind.1.html))
- `screencapture` - capture images from the screen ([man](https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/screencapture.1.html))
- `defaults` - access the Mac OS X user defaults system ([man](https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/defaults.1.html))
2017-11-09 01:10:12 +00:00
- `/usr/libexec/airportd`
- `scutil`
2018-06-14 15:48:42 +00:00
__INFO: `brew` ([link](https://brew.sh)) is highly recommended utility__