Since Apple’s OS X is based on UNIX, you can run many of the UNIX commands on your Mac right from the Terminal app. These commands help you accomplish a lot of tasks on your machine without having to work with the graphical user interface. In order for you to make use of these commands, you do not need to be a coder, as there are many simple commands that even a non-programmer can understand and execute on his or her machine.
In order to use these UNIX commands on your Mac, you need to have a utility called “Command Line Tools” installed on your machine. By default, OS X does not ship with this tool, and you need to manually install it. One way to install it is to install Xcode, and it will install these commands as well. But, Xcode is heavy (in filesize), and unless you are a developer, you won’t have any need for it.
In this tutorial we will show you how you can install the Command Line Tools without Xcode.
Note: this guide only applies to Macs that run OS X 10.9 and higher.
Installing Command Line Tools without Xcode
You are going to use the Terminal app to get the job done.
1. Launch Terminal by clicking on Launchpad in your dock and searching for and clicking on Terminal.
2. When Terminal launches, type in the following command and press Enter. It installs the command line tools.
3. You will get a prompt asking if you would like to install the command line tools on your machine. Click on the “Install” button.
4. Read the license agreement on the following screen and click on “Agree” to move forward.
5. You should see the following screen when the command line tools are being downloaded.
6. When the tools are downloaded, click on “Done” in the dialog box.
7. The command line tools are successfully installed without requiring you to install Xcode.
You are all set to enjoy the UNIX commands on your Mac.
Should you ever wish to uninstall the command line tools, you can do so using the following steps.
Uninstalling Command Line Tools
The uninstallation process does not use Terminal. Instead, the folder is removed manually by following these steps.
1. Open a Finder window, and click on the “Go” menu followed by “Go to Folder…”
2. When the Go to Folder panel opens, type in the following path and press Enter. It should take you to the directory where the command line tools exist.
3. You should see a folder named “CommandLineTools” on the following screen. Deleting it should remove the command line tools. You can do that by right-clicking on the folder and selecting “Move to Trash.”
The command line tools should now be removed.
If you need to execute UNIX commands on your Mac but don’t wish to install the huge Xcode app, the guide above should help you.