This article lists out different macOS terminal commands you might encounter. You can use this list as a starting point in your search for a command to perform a specific task. This list is by no means exhaustive.
Many of the commands have also been used in the article I wrote some time back. You can have a look at the scripts to see some of the commands being used.
To get more information about the commands simply run the following command from within Terminal Application. For example, to view the manual page for tmutil simply type:
Here is a nice command to quickly open the man page in the Preview App.
man -t tmutil | open -f -a /System/Applications/Preview.app
- This is not a complete list of commands
- Some commands are available through the macOS Recovery Volume only
- Some commands required other resources such as the OS installer
- Some commands are available with certain versions of the OS only
Please read the documentation for more details. Use the commands with care. Improper use of commands may result in loss of data or damage to the computer.
|startosinstall||Used to start the installation of macOS from the command line.|
|createinstallmedia||Used to create an external install disk.|
|fdesetup||Manage FileVault configuration.|
|security||Manage keychain and security settings|
|spctl||Manage security assessment policy|
|csrutil||Configure System Integrity Protection (SIP) settings|
|resetpassword||Password reset utility located in the Recovery Partition|
|hdiutil||Used to manipulate and manage disk images.|
|diskutil||Used to modify, verify, & repair local disks.|
|tmutil||Used to configure Time Machine settings in macOS|
|screencapture||Takes screenshot of the specified screen and saves the image at the specified location.|
|mdls||Used to get metadata attributes for a given file|
|mdutil||Used to manage metadata stores that are used by Spotlight|
|defaults||Used to modify plist files. Typically used to update preference files.|
|ioreg||Used to view the I/O kit registry|
|system_profiler||Used to generate system hardware & software reports.|
|plutil||Used to check syntax of property lists or covert property lists from one format to another|
|AssetCacheManagerUtil||Used to configure content caching settings.|
|open||Used to open documents from within the command line.|
|networksetup||Perform network configuration.|
|systemsetup||Used to configure machine settings in System Preferences.|
|launchctl||Used to manage and inspect daemons, agents, & XPC Services|
|codesign||Used to create, check, display code signatures.|
|pkgbuild||Used to build installer packages|
|productbuild||Builds a product archive|
|installer||System software and package installer tool|
User Account Management
|dscl||This is a command line Directory service utility that allows us to create, read, and manage Directory Service data.|
|sysadminctl||User account management|
|passwd||Change user password|
|login||Used to login to another user account.|
Server & Device Management
|profiles||Used to install, remove, list, or manage Configuration profiles.|
|serveradmin||Used to manage the services in macOS|
|mdmclient||Located in /usr/libexec/mdmclient it is used to manage interactions with the MDM.|
|asr||Apple Software restore: Used to copy volumes.|
|osascript||Used to execute the given AppleScript|
Share any commands you may know of in the comments window.
The information Is Provided “As Is”, Without Warranty Of Any Kind, Express Or Implied, Including But Not Limited To The Warranties Of Merchantability, Fitness For A Particular Purpose And Noninfringement. In No Event Shall The Authors Or Copyright Holders Be Liable For Any Claim, Damages Or Other Liability, Whether In An Action Of Contract, Tort Or Otherwise, Arising From, Out Of Or In Connection With The information provided Or The Use Or Other Dealings In The information.