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.
Used to start the installation of macOS from the command line.
Used to create an external install disk.
Manage FileVault configuration.
Manage keychain and security settings
Manage security assessment policy
Configure System Integrity Protection (SIP) settings
Password reset utility located in the Recovery Partition
Used to manipulate and manage disk images.
Used to modify, verify, & repair local disks.
Used to configure Time Machine settings in macOS
Takes screenshot of the specified screen and saves the image at the specified location.
Used to get metadata attributes for a given file
Used to manage metadata stores that are used by Spotlight
Used to modify plist files. Typically used to update preference files.
Used to view the I/O kit registry
Used to generate system hardware & software reports.
Used to check syntax of property lists or covert property lists from one format to another
Used to configure content caching settings.
Used to open documents from within the command line.
Perform network configuration.
Used to configure machine settings in System Preferences.
Used to manage and inspect daemons, agents, & XPC Services
Used to create, check, display code signatures.
Used to build installer packages
Builds a product archive
System software and package installer tool
User Account Management
This is a command line Directory service utility that allows us to create, read, and manage Directory Service data.
User account management
Change user password
Used to login to another user account.
Server & Device Management
Used to install, remove, list, or manage Configuration profiles.
Used to manage the services in macOS
Located in /usr/libexec/mdmclient it is used to manage interactions with the MDM.
Apple Software restore: Used to copy volumes.
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.
The Software 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 Software Or The Use Or Other Dealings In The Software.
Please try these scripts on a test computer. Some of the scripts do make changes to the system. Always test before using these scripts.
Disk images are a means of archiving data. They are created using a tool called Disk Utility which is a File System Management Utility of macOS. Disk Images follow the extension ‘.dmg‘ and are only compatible with macOS.
Disk Images are a popular way of distributing applications for macOS. They provide the capability of compressing large files and make delivery over the internet very easy.
In this article we are going to look at how we can create disk images for application distribution.
Creating the DMG Folder for distribution
Create a Background image. This can have any design. It’s a good idea to have arrows or other visual aids to assist others during installation.
Create a new Disk Image. Open Disk Utility.
Click on File > New Image > Blank Image
Leave the default settings as is. Choose the size that you desire.
Mount the Disk Image.
Create a folder called background in the mounted volume.
Save the background image in the folder we just created.
Now we will hide the background folder. Switch to terminal and run the following command.
mv background .background
Here we are simply renaming the background folder with a ‘.’ before it. This hides the folder from the GUI.
Now we will prepare the payload. This can be any file or folder we wish to install. For the sake of this demo I will be choosing Mozilla FireFox. In reality you would be distributing your own application.
Copy the FireFox app into the mounted volume.
Open “Show View Options“.
Restrict the mounted volume to icon view only. Feel free to customise the other settings as you wish. This includes icon size.
Drag and arrange the icons in your mounted window to match the background.
Eject the disk image.
Make a duplicate copy of the image file. This can act as a reference for future images you wish to create.
Now we will convert the disk image into a read only compressed disk image. This will be the one that we will use for distribution. Open Disk Utility.
Click on Images > Convert
Select the InstallerDMG.dmg from Desktop or wherever you had saved it.
Give it a new name and convert it to compressed format.
That’s it. You now have your own drag drop window ready for distribution.