macOS
The Unix-like operating system that runs on Macbook computers. Long known as "OS X".
Cheatsheet
Launchd
See wiki/launchd
Keyboard shortcuts
Navigation
- Switch between windows:
Cmd + Tab
- Switch between windows of the current program:
Cmd + Backtick
- See all open windows:
Ctrl + Up
- See all open windows of the current program:
Ctrl + Down
Screenshots
- Take a screenshot:
Shift + Cmd + 3
- Take a screenshot of part of the screen:
Shift + Cmd + 4
Finder
- Go to file:
Ctrl + Shift + G
Other
- Open emoji menu:
Ctrl + Cmd + Space
Flush DNS cache
sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder
sandbox-exec
$ sandbox-exec -f restrictions.sb CMD ARG1...
$ cat restrictions.sb
(version 1)
(deny default)
(allow process-exec)
(allow sysctl-read)
(allow file-read* (subpath "/"))
- https://igorstechnoclub.com/sandbox-exec/
- To view violations in real-time:
log stream --style compact --predicate 'sender=="Sandbox"'
Make a file downloaded from the Internet executable
xattr -d com.apple.quarantine path/to/file
Set default application to open file type
Find a file of the desired type, click "Get Info" in Finder, and use "Open With" section.
Can't eject drive because it is in use
- The volume can't be ejected because it's currently in use
- How to eject my external drive when my Mac refuses because of Spotlight?
diskutil unmount force /Volumnes/ian-ssd-t7