How Unix'y is Mac OS X?

36

15

From my limited knowledge: The Unix OS coder assumes the user knows what they're doing, etc. versus the Apple's you can only do it the way you are allowed to do it, etc.

Compared to other variations of Unix, what are Mac OS X's limitations, but also does it improve the user experience?

To try and clarify the question, it's more the user experience I'd like to read find out about. Although it's of interest that it's certified, that's not so relevant - Linux is not certified, but it's the closest I've come to using Unix up till now.

Rob Kam

Posted 2009-10-01T08:03:14.813

Reputation: 1 749

Question was closed 2012-09-08T16:59:06.190

4I find this question and its developments very interesting, thank you! – mouviciel – 2009-10-01T22:15:12.320

Answers

56

Mac OS X is plain Unix. This is a BSD Unix flavour, and is certified SUS V3 (Single Unix Specification version 3).

This means that everything that a software engineer or system administrator expects to find in a Unix system is present in Mac OS X.

mouviciel

Posted 2009-10-01T08:03:14.813

Reputation: 2 858

Edited the question to remove -like from Unix-like. – Rob Kam – 2009-10-01T08:14:16.353

1Edited my answer to remove -like from Unix-like. – mouviciel – 2009-10-01T08:19:52.520

In fact, OS X is so much "Unix-like" that you can compile almost anything out there written for Unix-(most likely Linux)machines and use it. – Wolf – 2009-10-01T08:59:37.447

It is actually MACH not BSD, though it has a BSD-like API. – kmarsh – 2009-10-01T12:58:02.363

14This is a BSD system built on top of a MACH microkernel. – mouviciel – 2009-10-01T14:00:20.260

@Wolf: You can't compile anything on a Mac until you install a compiler on it. I think that this applies to Mouviciel's "everything that a coder or sysadmin expects" as well. I expect a damn compiler, and OSX does not arrive with one (not out of the box). – Telemachus – 2009-10-01T15:20:44.247

3Telemachus - Yeah but in all fairness, most users won't ever use it and it's readily available in the XCode tools that is on the install disc that ships with all Apple computers. – MDMarra – 2009-10-01T15:38:57.580

@Telemachus: Xcode is an option that is present on the install DVD of Snow Leopard. Not exactly out of the box, but not far from it. It would be interesting to check whether a c99 compiler is present out of the box. It seems that it is mandatory with SUS V3. – mouviciel – 2009-10-01T15:39:07.237

@Mouviciel: I don't have a fresh machine handy, but I'm pretty sure that there is no compiler on current Macs out of the box (literally, fresh out of the box). And, yes, the installer isn't far away to get a compiler, but I still think it matters that it isn't installed by default. – Telemachus – 2009-10-01T16:33:33.727

5To be fair, if the stuff is on the disk, it is available "out of the box", depending on what box you're referring to. – Phoshi – 2009-10-01T17:05:45.863

1@Phoshi: Now we're just arguing semantics. When you take the machine out of the box and turn it on, there is no compiler. In order to get a compiler, you must either (1) become a Mac developer and download XCode or (2) know that a compiler is included in the "Optional" tools on an installer disc. That's not "out of the box" to me. – Telemachus – 2009-10-01T17:12:34.677

8@Telemachus: Most people who use a Mac don't want XCode, so installing it would be a waste of disk space. If you have any clue that you want a compiler, you can easily install one. If you need everything pre-installed for you, and you can't handle a simple installation step, you'll never make it in software, and shouldn't be trusted with a compiler. – David Thornley – 2009-10-01T17:30:09.230

3@David: I don't disagree about why Apple doesn't include a compiler. I'm simply saying that it's not there. That fact means that, in that regard, OSX is not especially Unix-like (license or not). In fact, as Mouvicel mentions, a c99 compiler is a requirement of the SUS spec, but I think Apple gets a pass by putting the XCode tools on a disc in the box. – Telemachus – 2009-10-01T17:34:36.023

8@Telemachus: The compiler is there. It's right in the box. I don't understand why you think all Unix-like OSes should work the way you want when you first turn on the power. There's a long and honorable tradition of fiddling things to make a Unix box work the way you want. – David Thornley – 2009-10-01T19:48:58.840

1@Tele, indeed we are :) I just don't think it's a major issue - if you want it, it's there. If you don't, well, it's not! – Phoshi – 2009-10-01T21:11:14.557

24

IMHO, this question can be interpreted in two ways. At the literal level, Mac OS X gained UNIX 03 certification with the release of Mac OS X 10.5 (Leopard), and is as Unix as it is possible to be.

On a more subjective level, Mac OS X is merely a rewrite of replacement for the classic Apple operating system, Mac OS. The interesting aspect of Mac OS X is that it is a POSIX compliant OS that happens to use an XNU kernel, which can trace its roots to BSD. And that it was released as an open-source project, Darwin. The POSIX compliance lets software packages written for Linux or BSD be ported to Mac OS X.

However, Mac OS X is more than just the kernel, and IMHO, Mac OS X is closer in spirit to Mac OS than to any other Unix variant.

Update: Link to Joel Spolsky's take on Biculturalism where he primarily talks of the schism between Windows and Unix cultures, but also touches briefly on why Apple succeeded in providing an excellent "Desktop Unix" with Mac OS X.

Update 2: Link to Unix philosophy as explained on Wikipedia.

"Write programs that do one thing and do it well. Write programs to work together. Write programs to handle text streams, because that is a universal interface."

My highly subjective opinion that Mac OS X is closer to MacOS than a "traditional" Unix OS stems from my opinion that Mac OS X has usability as its overriding goal, and not the above. That said, I do agree that it is also valid to consider Mac OS X a true Unix by focusing on the many points of commonality.

user4358

Posted 2009-10-01T08:03:14.813

Reputation:

8Mac OS X isn't a rewrite of the classic Mac OS at all — it's based on NeXTSTEP. – s4y – 2009-10-01T16:01:05.417

1@SidneySM: In a way, it's lineage is irrelevant. When you use OSX, it feels like Mac a lot more than like Unix. – Telemachus – 2009-10-01T16:54:32.203

1@SidneySM Thanks, you're right. By "rewrite" I meant to convey that it didn't have any code in common with its predecessor, the Mac OS, and not that it was rewritten from the ground up. It obviously didn't come out right. I'll fix it asap. – None – 2009-10-01T17:01:18.337

MacOSX is a real live Unix with a very different UI layer on top. You can always drag the terminal app into the dock (I did) and have fun with using the Unix internals from the command line (I do). – David Thornley – 2009-10-01T17:32:13.157

@David Thornely All Unix and Unix-like systems I've worked on can be administered completely from the command-line, and the GUI is a component you can turn off. They also have minimal to no functionality that can be achieved only via GUI. OS X is very different on both counts, wouldn't you agree? My point is that while it is very Unix-like on many counts, it is equally un- Unix-like on many other counts. However, it is MacOS-like on almost all counts. – None – 2009-10-01T18:27:49.567

@nagul: I'm not as up on MacOSX administration as I could be (I live mostly on the Ubuntu box), so what administration requires the GUI? Bear in mind, also, that when I was administering an AIX box a long time ago I didn't want to have to do administration via the command line, but stuck to the supplied tools. – David Thornley – 2009-10-01T19:51:35.480

@David Thornley How about booting into a console and then being able to start up and shut down the GUI interface on demand? Or changing default file associations? Or changing power management behaviour? There are a million small things not easily tweakable from the console, because the Mac environment and culture don't encourage or need it. The strength of the Mac is in the GUI, and you're encouraged to stick to the supplied GUI tools. The situation tends to be reversed on Unix systems. Even when the GUI tools are good, they tend to be composed from equivalent CLI bases. – None – 2009-10-01T21:41:06.587

1

@David Thornley We can debate this ad nauseum, but possibly our differences lie in our interpretation of the Unix philosophy. http://en.wikipedia.org/wiki/Unix_philosophy I happen to think OS X is geared towards usability, and not this (especially the last bit): "Write programs that do one thing and do it well. Write programs to work together. Write programs to handle text streams, because that is a universal interface."

– None – 2009-10-01T21:47:14.873

@Nagul: the Unix philosophy quote helps a lot. I wish one of us had put that in our original post. You should think about moving it up into your answer. – Telemachus – 2009-10-02T00:41:30.033

@Telemachus: Thanks, I just updated my post with the quote. – None – 2009-10-02T09:08:27.447

3If you follow the traditional UNIX philosophy too literally, you can't have a graphical desktop environment. – hasen – 2009-10-21T07:14:57.887

12

Open a Terminal and it's Unix. Use the GUI, and it's OS X. Many of us consider this the best of both worlds.

I never would have switched to Mac if there wasn't a Unix underneath.

Max Howell

Posted 2009-10-01T08:03:14.813

Reputation: 587

I am switching to a Mac because of this. However, I really want to see their future OS versions (Yosemite, etc) pass the latest UNIX specification. – Kensai – 2014-10-11T22:37:15.503

11

As some of the answers have said, there are two sides to this question.

If you mean a license, then OSX is official Unix (TM).

On the other hand, if you mean does OSX feel like a Unix system, I would have to say not really (or maybe "not exactly"). OSX goes out of its way to hide away quite a lot of the Unix-y filesystem from you. Compare the output of ls / with opening the main hard disk drive in the GUI. It also doesn't have a compiler installed. (It is available in the box and you can install one pretty easily by installing the Xcode tools, which are readily available on one of the installer discs, but they're grouped under "Optional" or "Extra" install items. I forget the exact wording.) These are two big examples, but there are many other examples of little things that are just a bit off or different in OSX. (Not good or bad, necessarily, but different.)

Apple works very hard now, I think, to provide their default "Just works" friendly face to the majority of their users while also allowing developers and geeks to treat OSX like a standard *nix machine. But the result makes OSX systems a bit of a compromise. (That's not necessarily a bad thing.)

Edit: It's interesting how strongly people feel about this question (me included). I think that some answerers are being very literal: It's as Unix as Unix can be because they have a piece of paper that says so from Unix (TM). Others of us are saying, "But it looks like, walks like, and quacks like a Mac. It doesn't feel at all Unix-y (much less look it)." As I said originally, I think that there are really two questions here: one about the specification and license and one about user-experience.

Telemachus

Posted 2009-10-01T08:03:14.813

Reputation: 5 695

3You can get the output of ls / with Terminal.app. Both worlds coexist in Mac OS X. This is not a compromise. The GUI works on top of Unix, just like Gnome works on top of Linux. – mouviciel – 2009-10-01T15:49:56.063

1What Unix are you using that the development system is part of the default install? – Richard Hoskins – 2009-10-01T16:21:14.033

@Mouvicel: My point is that quite a lot of the items visible with ls -l are made invisible in the GUI. You don't see /bin, /etc and so on. To clarify this: I find it bizzare (and telling) that Apple goes out of its way to hide these items. – Telemachus – 2009-10-01T16:35:37.110

@Telemachus, You can have the Finder display everything http://www.osxfaq.com/DailyTips/02-2005/02-01.ws

– sal – 2009-10-01T16:54:10.863

@Sal: well and good, but there's a reason that Apple hides that stuff. That reason, which I may not be able to express clearly, is what makes me say that Apple has deliberately hidden the Unix in their operating system. – Telemachus – 2009-10-01T16:58:20.823

1@Telemachus +1 for duck-typing. It expresses the spirit of the change from Mac OS to OS X succintly. In my opinion, Apple wanted to improve the guts of the Mac while keeping the user experience unchanged, and succeeded quite beautifully. – None – 2009-10-01T17:11:56.990

@Mouvicel: To clarify the key thing, in Gnome what you see in a terminal (using `ls -l) and what you see in the filemanager (Nautilus) is identical. For various reasons, Apple does some voodoo magic to make the GUI show fewer items than the terminal (and not just hidden dotfiles). I find that telling. – Telemachus – 2009-10-01T17:21:05.877

There is a compiler in the box. – David Thornley – 2009-10-01T17:34:52.463

@David: Fine, I edited my answer to avoid the phrase "out of the box." There is no compiler installed on OSX by default. – Telemachus – 2009-10-01T17:40:19.023

2@Telemachus: There wasn't one installed on my first Ubuntu box. I had to go to the work of typing "sudo apt-get install development-essentials", and then entering my password. It did surprise me. – David Thornley – 2009-10-01T19:52:50.813

2@Telemachus: I understand your point and considering the edit of the OP, this is the kind of argument he wants to get. From a user point of view, there is no hint that Unix runs under the hood. – mouviciel – 2009-10-01T22:11:14.280

5

I'd say Unix can only be defined by the various Unix flavors out there.

Consider the question: what's Unix like?
The Answer: Try a Unix system to get a feel for it.

If OS X is certified Unix, then what are you really asking?

Are you asking how close is it to the traditional gui-less Unix from the 80's?

Well, in that case, one can ask, how Windows is Windows 7? It's certainly "official" windows, but it doesn't feel anything like Window 95, let alone 3.1, not to mention MS-DOS. Does that make it any less of a Windows?

Just because normal (non-tech) users don't see the Unix underneath the GUI, doesn't make OS X any less Unix than it is.

hasen

Posted 2009-10-01T08:03:14.813

Reputation: 4 556

@Hasen: in addition to certification there is a question of philosophy. The traditional Unix philosophy stresses things that OSX emphatically does not stress. See Nagul's answer for more on this. Modern Unix-like systems certainly have a GUI, but they still follow (to one degree or another) the base philosophy. I'm not sure that Apple's OSX really does. – Telemachus – 2009-10-02T11:42:03.910

1@hasen j: I'm very comfortable using Win XP on the desktop. Although I'd like to, I'm unable to find a Linux or Unix variant that I enjoy using enough to replace it. I'm wondering here, if perhaps it's worth trying to see what Mac OS X, as a variant of Unix on the desktop, feels like. – Rob Kam – 2009-10-02T12:18:52.637

4@Rob Kam: Mac OS X is an extremely good OS on its own right. Despite the PR-ridden cliche, to a large extent it just works. If you haven't enjoyed your dose of Unix till now, I'd certainly suggest you try out a Mac. It is not my idea of a traditional Unix OS, but it is underpinned by both Unix and POSIX compliance and it is an excellent OS. – None – 2009-10-02T20:06:34.537

4

The GUI is the one that hides the feature. Underneath it feels like a BSD with some cosmetic differences, and some platform differences.

When you drop to a shell, a *nix user won't feel all that out of place. I routinely do that with my MacBook anyways.

calyth

Posted 2009-10-01T08:03:14.813

Reputation: 223

4

A significant point is how much you can do only via the GUI, and the answer is surprisingly little -- including modifying GUI settings or running AppleScripts. There are programmable command line interfaces to almost everything, and quite a few Unix utilities are also included without being explicitly mentioned, Subversion for instance.

As a matter of opinion, having been a Unix workstation user since the mid 1990s, Mac OS X is kind of like the Amiga and BSD had a love child that ran away and was trained in kung-fu in the mountains by IRIX.

nth

Posted 2009-10-01T08:03:14.813

Reputation:

An interesting analogy. In my mind Amiga represents: powerful use of resources, ahead of it's time but especially that (when sufficiently tweaked, e.g. with Directory Opus) it was fun to use. – Rob Kam – 2009-10-02T09:18:48.550

3

The difference that stands out the most for me is that the default Mac OS X file system, HFS Plus, is not case sensitive. It is possible to use UFS, but this can limit the functionality of other parts of the OS. It was a bit jarring when I discovered the lack of case sensitivity. At least it is case preserving.

Spudicus

Posted 2009-10-01T08:03:14.813

Reputation: 51