You might be wondering what on earth is Mac UNIX? There are several places throughout this website , including the security and virus sections, where the UNIX roots of Mac OS X are made out to be something special. One thing is certain Mac OS X would not be what it is today without these historical roots.
UNIX brings with it a powerful set of tools and features that improve the security and stability of your Mac computer.
But why? What exactly is UNIX? If you know the answer to this question, are already familiar with the command line, and understand the file system, then this page is probably not for you.
But you might find our Mac OS X command line section a useful reference for commands. If you are not familiar with UNIX then read on, it is a fascinating story.
In order to understand what makes Mac OS X what it is today we need to travel back in time to the 1960's.
These were the early days of computing, various teams around the world were researching exactly what could be achieved with this new technology. Even though it seems hard to believe their was no, single, dominant operating system like there is today. A new era was dawning and we take it all for granted today!
In 1969, engineers working for AT&T, at Bell Labs, developed a new multi-tasking and multi-user operating system which they named UNIX. Apparently, it is not an acronym, instead it was a pun on the name "multics" which was an operating system created just before UNIX.
The web is full of other possible acronyms but it doesn't really matter. I suppose UNIX is just UNIX, it doesn't need to be known by a different name.
In 1970, AT&T decided to release the UNIX source code to various Universities so that they could help develop and improve the code.
Possibly the most influential were the modifications made by the Computer Systems Research Group (CSRG) of the University of California, Berkeley, from 1977 through to 1995, when they released BSD 4.4 Lite release 2.
This became the base for many BSD derivatives, such as FreeBSD and NetBSD, that are still going strong today.
In 1985, after Steve Jobs resigned from Apple, he founded NeXTSTEP, a computer company specialising in high-end workstations for business and education.
These computers ran the object oriented NeXTSTEP operating system, which was also based on the Mach Kernel and was another derivative of BSD UNIX.
In December 1996, Apple bought out NeXTSTEP at the same time that Steve Jobs returned as CEO of Apple. This is where the story becomes relevant to Mac OS X. In 1999, Apple released the first version of their Mac OS X Server operating system, which was based on the NeXTSTEP operating system.
Then, in 2001, Apple released the first consumer version of the Mac OS X desktop operating system, called "Cheetah", which was based on NeXTSTEP and FreeBSD. This combination became Darwin which has stayed at the core of Mac OS X ever since.
With the release of Mac OS X 'Leopard', version 10.5, in 2007, Apple confirmed the pedigree of its UNIX roots by registering Mac OS X as an Open Brand UNIX 03 Product, conforming to the SUSv3 and POSIX 1003.1 specifications. Every version since then has received the same registration including OS X Lion.
If you are a user who simply uses the Mac OS X Desktop GUI and is not interested in what happens underneath, then just be content with the knowledge that the Mac UNIX roots are what helps make your Mac so secure and resistant to viruses.
Simply keep using it exactly the same way that you always have! However, if you are interested in harnessing the power of the command line, then you need to know a bit more about it.
For example, how it works, how you enter commands, where you enter the commands, and what exactly are the commands.
No, the command line is one of the most important parts of UNIX because it allows users to interact, to control the system, to administer the users, etc.
But UNIX is the software that makes your Mac tick. It allows your Mac to boot-up, to detect external devices and allocate drivers, to allow multiple users to access the computer without messing with each other, to allow many different tasks to run concurrently.
Any operating system is a complex piece of software. UNIX just happens to be one of the most mature, and as a result one of the most stable.
Before we can show you anything about the command line , we need to introduce you to the utiltiy that provides the interface between you, the Mac user, and the inner workings of UNIX on your Mac computer.
The good news is that it is already on your Mac, just waiting for you to start using it. If you open the applications folder you will find another folder named Utilities. In this folder you will find a utility called 'Terminal', click on the icon and you will see the window in the screenshot below.
The Mac OS X Terminal Window
Looking at the terminal you can see two lines of text. The first is simply a message, the last time and date that you logged in. The second is the command prompt, and displays two bits of information. The name of the system you are on, in this case, localhost, and the user name, in this case jordan. These will off course be different on you Mac.
The little grey square is the cursor and is marking the point where a text can be entered e.g. A command.
When you first open the Terminal, it is simply waiting, waiting for you to enter a command.
If you hit the enter/return key you will see it move down a line and display another prompt. This was because you didn't enter a command, so it couldn't do anything. It just waits for the next command.
At this point I want to demonstrate that when you enter a command followed by enter, an action is performed, some text might be displayed, and then it returns to the prompt. At the moment you have a prompt similar to that shown below.
localhost:~ jordan$
Now simply type in the command 'ls' followed by enter. You should see some text displayed and then the prompt, as shown in the screenshot below.
Mac OS X Terminal After ls Command
In order to explain what just happened, let's look at something that you are more familiar with. The screenshot below shows the Finder window, with the 'Home' icon clicked in the sidebar.
The main window shows all of the directories in my home directory, including my Dropbox directory.
Finder in Home Directory
Looking at the Terminal screenshot again, from above, that I have reproduced below. You can see that the result of the 'ls' command is a listing of all of the directories in your Home directory.
Mac OS X Terminal Showing Home Directory
The 'ls' command is the 'list' command, and displays the directories and files in the directory that it is currently looking at.
This page is just intended to give you a quick overview if what Mac UNIX is. But I think one more example would give you a good insight to the power the Mac OS X command line offer you.
If we go back to the Finder and click on the Documents folder we get the Window below showing us all of the documents in that folder.
Finder in Documents Directory
This time let's go back to the Terminal and enter two commands. First, enter the command 'cd Documents', hit return, then enter 'ls' followed by enter.
The screenshot below shows the effect of these two commands.
Mac OS X Terminal Showing Documents Directory
So what happened? Well, first we used the change directory (cd) command to move into the Documents directory, and then we used the list (ls) command to list the files, like we did previously.
You should be able to see the same files listed in the screenshot above as in the Finder window.
At this point I think it is worth making you aware that commands can be more complicated that the ones we used above. A commands function can be altered slightly by using what we call 'switches'.
This time enter the list command again, but as shown below, add '-l' on the end as shown below;
localhost:~ jordan$ ls -l
You will get the same data displayed as before, but this time it will be in a continuous list as shown below.
Mac OS X Terminal Listing Directory
To close this section we thought it would be interesting to show you a more complicated command, to highlight how powerful these commands can be. The command shown below switches off the Window animation in OS X Lion.
defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool NO
If you are interested in more of these settings then visit our Mac OS X Tweaks page for more commands like this.
A common trend on this website is discussions about just how secure Mac OS X is compared to other operating systems. One reason for this is that Mac UNIX allocates permissions to every file and directory on your Mac.
At the moment, because this is just an overview of Mac UNIX, I don't want to make this too complicated. But the line shown below was produced using the list command that we discussed above.
-rw-r--r-- 1 jordan staff 33432 3 Oct 23:05 ebook.pdf
If you look at the beginning of the line you will see a block of characters that have been reproduced below;
-rw -r- -r--
As you can see there are effectively 3 blocks of characters. The first block of three represents the user who owns the file and she can both read (r) and write (w) to the file.
The second block of three applies to the members of the group who the owner belongs to, in this case the 'staff' group. Members can read (r) this file, but cannot write (-) it.
The third block of three represents other Mac users, who like the group members, can read the file but cannot write (w) to it.
If any blocks were all dashes (---), then those users would not have access to the file.
Don't worry if you didn't totally follow that description. We will be posting a more in-depth tutorial shortly, but simply wanted to demonstrate what helps to make Mac UNIX so secure.
Well, that completes the overview of Mac UNIX. Although intentionally short, it demonstrated the Terminal, entering commands, text output, as well as the use of switches to extend commands. We also heard what tasks UNIX performs and what built-in functionality helps to make your Mac more secure.
Visit our Mac OS X Command Line section for a more in-depth explanantion of the different commands available in Mac OS X.