Having used macOS/OS X for several years, I have come to realize that sometimes command line (cli) access for system preferences can be vital or life-saving when running into problems with macOS’ system functionalities. Additionally, macOS also comes with a bunch of useful functionalities only accessible via command line (some of them require installation via xcode-select --install
).
Sadly, many of these exist without having been updated for years and their documentations have been moved to Apple’s Document Archive website. It is really disappointing that Apple seems to be no longer advocating command line operations for users of Macintosh.
Anyway, the following is an incomplete quick index of corresponding cli commands I have discovered for managing several macOS configurations/services. Most of these commands reside under /usr/bin
or /usr/local/bin
.
References:
man
pages of corresponding commands from either a macOS distribution or Apple’s Documentation Website
- Quick Look Manager (previewing files using Space Bar):
qlmanage
- Profiles Manager:
profiles
- Plist Utility:
plistutil
- Editing system-wide or app-specific preferences and/or default settings:
defaults
- Core Audio daemon:
coreaudiod
(normally, restarting this daemon viasystemctl restart coreaudiod
may solve potential “no audio output” issues for macOS/OS X) - Spotlight metadata management:
mdutil
- Kernel extension utilities:
kextutil
- Preventing the system from sleeping:
caffeinate
- Wireless diagnostic:
wdutil
- Time Machine management:
tmutil
- Audio file info:
afinfo
- Image processing and conversion:
sips
- TIFF image manipulation:
tiffutil
- Privacy database access control:
tccutil
- SMB (SAMBA) requester control:
smbutil
- Notification command line utility:
notifyutil
- HID event system debug utility:
hidutil
- Disk images manipulation:
hdiutil
- CD/DVD burner interactivity:
drutil
- Configuration for system security policies:
csrutil
- Touch ID configuration management (for Touch ID-enabled MacBook models):
bioutil
- Font management:
atsutil
- Some checksum commands:
md5
,md5sum
,shasum
(also available variants:sha1sum1
,sha224sum
,sha256sum
,sha384sum
),crc32
Apple, macOS, OS X, Macintosh, MacBook, Quick Look, and Touch ID are registered trademarks of Apple Inc.