14

I want to know what the actual difference between Unix and Linux is.

  • Do they share the same kernel?
  • Is Linux built on Unix?
  • Do programs written for Linux work on Unix and vice-versa?
6
  • because who else know linux and unix source code ?
    – Xinus
    Sep 18, 2009 at 8:47
  • 6
    I don't think you need to know Linux & Unix source code to know the history of the two operating systems. Sep 18, 2009 at 9:06
  • Maybe then you need to know Windows and Linux source code to call them differences?
    – Pawka
    Sep 18, 2009 at 9:27
  • 4
    Linux -> Linux Is Not UniX :)
    – ukanth
    Sep 18, 2009 at 9:38
  • yep.. but directory structure of both of them is so same, you have to dig into the source to understand the differences or at least block diagram can show the difference.. windows on the other hand have completely different directory structure so we feel the difference ... thats why I wanted to know it..
    – Xinus
    Sep 18, 2009 at 10:08

6 Answers 6

22

Unix isn't one thing, it's a name for a large family of related operating systems, which share to differing degrees, history and architecture. Solaris, DEC Unix, IRIX, HP-UX are Unix variants. They are to some degree compatible to applications, since they implement POSIX standards to differing degrees, which means they expose similar commands and APIs.

Their kernels are not the same, though if you look up 'unix family tree' you will see a fascinating history of how these variants have evolved from one another, like organisms. That is, a finch and a swallow aren't the same animal but they have much in common.

Linux is a re-write, from scratch, of a Unix-like operating system. Whether programs written for one Unix/Linux versus another is a complex question, but in some cases yes.

22

No, No, Yes (source)

To really understand the answer it helps to look at the history of both operating sytems.

Unix was invented at AT&T Bell Labs by Ken Thompson. His colleague Dennis Ritchie contributed and also invented the C language and wrote the C compiler. Over the years, code was also contributed by UC Berkeley, further work at AT&T, Sun, IBM, and others.

It was eventually standardized in a series of publications called POSIX. Overall, the code was proprietary, as it was copyrighted by AT&T and then sold off or licensed to other companies, who largely rewrote it over the years but retained various rights.

Two branches of "free Unix" emerged in the 1990's. One was Linux, which is a clone, written to act like Unix without containing any actual Unix code.

The other branch exists today as NetBSD, and which was followed quickly by FreeBSD, and then much later by any other *BSD you may have heard about. These projects are a bit different from Linux in that they are "partial clones". They contain a mixture of "real Unix" source code (the part that was freely licensed, mainly by UC Berkeley) and some newly written "clone" code and other later code emerging as part of rewrites or as needed to support modern HW and modern Posix specifications.

Linux is a lot more popular because NetBSD and FreeBSD were tied up for a while in a lawsuit between AT&T and UCB. Although resolved in favor of the BSD's they never recovered from the delay, at least, not in terms of popularity.

So no, Linux and commercial Unix don't have any kernel code in common, although commercial Unix and *BSD once did have quite a bit in common. The Unix kernels from the licensed vendors contain code that they wrote themselves, perhaps with some original AT&T code still present here and there. The Linux kernel consists of code written by Linus Torvalds and other authors.

"Unix software" is software written to the Posix API's and typically runs on all versions of Unix, Linux, and NetBSD and FreeBSD. In theory, Posix SW can run on "non-Unix" systems but that doesn't seem to work out very well. These days, "Unix" is technically a trademark, but tends to be used informally as a designation for both commercial Unix, Linux, and the BSD family.

1
  • Actually BSD Unix is the most widespread in terms of sold devices: it's the core of Apple OS X present in Macs, iPhones and iPads.
    – mouviciel
    Jul 21, 2010 at 15:56
8

When most people talk about unix they mean a "Unix-like operating system that is POSIX compliant", which Linux is.

Do they share a same kernel? No, Linux IS a kernel, not an operating system. Technically, Linux distros use a Linux kernel and a GNU (see gnu.org) "userland". The userland is the basic programs and libraries etc. that bridge big applications and user tasks to the kernel's low-level API.

Is Linux built over Unix? No, it's a clone. It's built to provide a free, usable version of Unix on a lowly desktop PC.

Can programs written for Linux work over Unix and vice versa? Sometimes. For example, on FreeBSD, there is a Linux ABI emulator, which essentially detects that programs were made for Linux, and makes a different set of kernel calls available. Something similar is available for Linux to run standard Unix System V stuff (or some popular commercial version of unix anyway), but it's rarely used, as most programs come as POSIX-compliant source code, and compile on Linux without difficulty. Also, most binary programs for unix are directly available for Linux. FreeBSD is a smaller concern, and doesn't have this luxury. In Linux, the system to load binaries from other systems is most often used to run java programs, windows programs (although this is ill-advised), etc.

Unix is a trademark, and so Linux can't use the name. Unix is the official, old version (inasmuchas there is an official version), which isn't so user friendly. Most other versions of unix were designed a little better, but don't necessarily work as well in practical terms. That's about it really. Many of the companies that used to run Unix now run Linux.

If you want to see the differences in various unix-like operating systems, get yourself a copies of FreeBSD, OpenSolaris, and Debian. I say these distros specifically because they'll be easier to compare, although some others like pc-bsd, nexenta, and ubuntu are arguably nicer, respectively.

4
  • 2
    Linux is not completely POSIX compliant.
    – MDMarra
    Sep 19, 2009 at 1:50
  • I could be wrong, but AFAIK, for all intents and purposes, it is. It was certified POSIX compliant in the past, but getting the ACTUAL certification costs, and so it's not really done given that Linux is a constantly evolving free software project. The distro (Linux-FT) that got certification with an even higher standard back in the late 90's (FIPS something-other-other) declared their intention to help fold their work into the mainstream kernel. Since then, LSB (a superset of POSIX.1) has arisen, and been adopted by at least some distros.
    – Lee B
    Sep 19, 2009 at 10:14
  • @unknown poster: I suppose the true test of Unix these days is SUS -- the Single Unix Specification. Linux does NOT comply with this, as far as I know. Not sure if that's merely a technicality, but I suspect it's more --- Linux can be slow to develop features that are usually CONSIDERED unnecessary in pragmatic terms, for whatever reasons. However, whether that's still relevant is another question, given that Linux is probably THE most popular unix variant now. Other unices are having to add Linux features, as much as vice versa.
    – Lee B
    Sep 19, 2009 at 10:18
  • Don't they call that *nix?
    – Hello71
    Jul 21, 2010 at 20:03
2

I think technically speaking, GNU/Linux is not less of a UNIX than any of the official UNIX systems, but it's only for legal reasons that people describe Linux as a UNIX-like OS, instead of just a "UNIX" OS.

As far as kernels are concerned, Linux is a kernel. So by definition, if a system uses the Linux kernel, then it's a Linux system, not a UNIX system.

Is Linux built over Unix

Linux was not built "over" Unix, it's built as a UNIX clone. All the various gnu utilities (bash, etc) were written from scratch as clones of the corresponding unix utilities.

Ironically, Mac OS X, which has a UNIX core, ships with bash, gcc, and possibly other GNU utilities. So that's a UNIX system that includes parts of GNU, and not the other way around as one might expect.

0

UNIX History Not the answer to your questions, but maybe will be interesting.

-2

From NixCraft

UNIX is copyrighted name Only big companies are allowed to use the UNIX copyright and name, so IBM AIX and Sun Solaris and HP-UX all are UNIX. The Open Group holds the UNIX trademark in trust for the industry, and manages the UNIX trademark licensing program. Linux is UNIX clone

But if you consider Portable Operating System Interface (POSIX) standards then Linux can be considered as UNIX. To quote from Official Linux kernel README file: Linux is a Unix clone written from scratch by Linus Torvalds with assistance from a loosely-knit team of hackers across the Net. It aims towards POSIX compliance. Linux is just kernel

Linux is just kernel. Linux distribution includes GUI system, installation and management tools, compilers, editors etc. Linux distribution makes it

Most UNIX oses considered as compete operating system.

As I said earlier Linux is just kernel with Linux distribution makes it complete usable os. Most UNIX oses comes with A-Z programs such as editor, compilers etc. For example FreeBSD comes with A-Z programs. License and cost

Linux is Free (as in beer [freedom]). You will see best community support around. Many UNIX oses are not free (but this is changing fast, for example OpenSolaris/Solaris UNIX). User-friendly

Linux is considered as most user friendly UNIX like os. It makes easy to install sound card, flash players, and other desktop goodies. End user perspective

The differences are not that big for the average end user.

1
  • 1
    The errors about the relative costs of Linux and FreeBSD aren't in what's supposedly being quoted here. Nonetheless, one should not trust an explanation that mixes up copyright and trademark and conflates "freedom" with "as in beer", both of which errors are in the original.
    – JdeBP
    Feb 18, 2014 at 17:18

Not the answer you're looking for? Browse other questions tagged .