Beginners Start Here: Mac OS X’s Unix Underpinnings

Sean McNamara
4 December, 2008
View more articles fromthe author
AAA
Help

Apple has made much of Mac OS X’s Unix-like foundation since before the days of the Public Beta. What does this mean from the practical point of view? Should ordinary users like you and me care about this usually hidden part of the operating system?

Since the acquisition of Next and its NextStep operating system, Apple has continued to refine this part of its operating system to the point that Mac OS X v10.5 achieved UNIX 03 certification. Despite the delay in this certification process, the underbelly of Mac OS X has been so Unix-like that the point was, for all intents and purposes, moot. For that reason, I won’t continue to make a distinction between Unix-like and Unix: Mac OS X has a Unix foundation, and the points I’ll be covering are the same whether it has the certification or not.

So what’s the point of talking about something which is usually hidden? It’s probably better to describe this Unix underbelly as being obscured or abstracted, rather than hidden. It’s still there, it has many effects on how Mac OS X works and how the user interacts with it, but Apple has tried to mask its presence in day-to-day use to make Mac OS X one of the most (if not the most) user-friendly Unix variants there is.

Let’s take a look at one of the features of Unix which has been around for a lot longer than Mac OS X — multiple users and authentication/authorisation — to see what Apple has done to make our lives as users easier while keeping the strengths of this feature relevant.

Traditionally, Unix operating systems would, on booting, present the user with a blank screen with a username/login prompt. Enter the username, and you’re presented with a password prompt – enter the password correctly and you’re presented with a command line prompt – you’re now in the command shell, ready to weave your Unix magic.

Most Mac OS X machines are used as single user machines, so, although the multiple-user capabilties are always present, Apple obscures the feature by turning autologin on by default. This means the user isn’t presented with a login screen unless they turn off the autologin manually. To make the handling of this feature simpler, when a second account is set up Mac OS X asks if autologin is to be left turned on or if it’s to be turned off – in a multiple user setting, a login screen may be more appropriate than automatically signing in as the first user account, but Mac OS X doesn’t assume, it asks.

Even if you do choose to turn off autologin, Apple has designed a login screen which is much prettier than the standard Unix text-based one. By default, a list of users with their account picture is shown so that the appropriate account can be clicked on to then move on to password entry (you can change this to text fields with no accounts list so that both pieces of information have to be typed in).

Another way in which Unix’s user-model comes into play is when the user tries to do administrative tasks. In traditional Unix text-based shells, the user indicates that an operation is to be done in administrative mode by either prefixing the command with “sudo” (for “super-user do”, super-user being another word for the root user, which is the main administrative account on Unix systems), or by entering “super-user mode” by typing the “su” command, which tells the shell to switch to a mode where all commands are run as the root user.

On Mac OS X, if you try to do something which requires administrative privileges, you’ll be prompted with an authentication dialog box. Mac OS X is doing the standard Unix stuff “behind the scenes”, but is presenting a much nicer, friendlier face than traditional Unix.

The same is true for many different areas of Mac OS X. For example, the Installer application can install Unix applications just as easily as standard Mac OS X ones ones, and it does it with the same friendly graphical interface that we’ve come to expect from our operating systems.

But for those a little braver, the Unix internals are always ready to be peeked into at a moment’s notice. Just fire up the Terminal application in the Utilities folder, and you’ll be logged into a traditional Unix shell, where you can do traditional Unix shell things. You can navigate the file system, run command line tools, compile new Unix programs or just hang around a text-based environment to your hearts content.

It’s not essential (or usually desirable) for you to delve under the hood in this way, but for those who need it, it’s good to know it’s there and provides further flexbility to Mac users.

Leave a Comment

Please keep your comments friendly on the topic.

Contact us