I am a long time linux user and have recently become interested in playing about with BSD-based operating systems. What are the differences between linux and BSD-based systems. I am interested in learning about the functional, practical and also historical differences.
BSD vs Linux – Main Differences Explained
bsdhistorylinux
Related Solutions
The term "userland" can refer to many things in different contexts, but here I interpret "GNU userland" vs "BSD userland" as the default, minimum set of programs that come with a distribution.
The big main difference is that the two userlands start with completely different source code. GNU cat source code NetBSD cat source code. Just from that simple-in-concept program, you can see that NetBSD's cat uses traditional, single-letter command line flags. GNU programs tend to have single-letter flags, but also the --something-long
type options. GNU programs also tend towards POSIX compatibility.
That difference in source code will lend the two userlands different behavior in some cases.
It also looks like NetBSD (at least) uses its own version of libc, the standard C library. I'm getting in over my head here, but libc and dynamic linking are strangely inter=related. Again, different source code will lead to different behavior.
I think that as a shell user, you'd find that ps
would act different, and ls
might give you slightly different output than you're used to. You'd have to find equivalent command line flags for some programs, if you use the --long-option
type of command line flags.
Historically, my understanding is that BSD userland descends more directly from V6 and V7 Bell Labs Unix, via the 32V port to VAX hardware. GNU userland is newer, written at least somewhat in reaction to AT&T's attempts to keep code a closely guarded secret in the early 80s. After the 1983 Bell System divestiture, AT&T tried to "monetize" Unix. Part of that was to license the source code in a way that prevented most people from ever seeing it. Richard Stallman and others had problems with this. Their GNU project existed specifically to create a freely-shareable Unix-like system.
In the meantime, by 1993, AT&T sued the University of California system over the BSD ('B' is Berkeley, where University of California is located) systems. People at Berkeley had replaced all of AT&T's original source with new code, and that new code became the ancestor of at least NetBSD's userland. AT&T and UCB came to a settlement in 1994, revealed to the public in 2004.
Naturally, at least ideas cross-pollinate, so there's at least conceptual similarity between GNU and BSD userland, but corner cases definitely differ.
The Ubuntu bsdtar
is actually the tar implementation bundled with libarchive
; and that should be differentiated from classical bsdtar
. Some BSD variants do use libarchive
for their tar implementation, eg FreeBSD.
GNUtar
does support the other tar variants and automatic compression detection.
As visualication pasted the blurb from Ubuntu, there are a few things in there that are specific to libarchive
:
libarchive
is by definition a library, and different from both classicalbsdtar
andGNUtar
in that way.libarchive
cannot read some older obscure GNU tar variations, most notable was encoding of some headers in base64, so that the tar file would be 7-bit clean ASCII (this was the case for 1.13.6-1.13.11 and changed in 1.13.12, that code was only officially in tar for 2 weeks)libarchive
'sbsdtar
will read non-tar files (eg zip, iso9660, cpio), but classical bsdtar will not.
Now that we've gotten libarchive
out of the way, it mostly comes down to what is supported in classical bsdtar
.
You can see the manpages yourself here:
- GNU tar(1)
- FreeBSD tar(1) - libarchive-based
- NetBSD tar(1)
- OpenBSD tar(1)
- Standard/Schily tar(1) - the oldest free tar implementation, no heritage to any other
- busybox (1) - Mini tar implementation for BusyBox, common in embedded systems
In your original question, you asked what are the advantages to the classical bsdtar
, and I'm not sure there are really any. The only time it really matters is if you're trying to writing shell scripts that need to work on all systems; you need to make sure what you pass to tar
is actually valid in all variants.
GNUtar
, libarchive
's bsdtar
, classical bsdtar
, star
and BusyBox
's tar
are certainly the tar implementations that you'll run into most of the time, but I'm certain there are others out there (early QNX for example). libarchive
/GNUtar
/star
are the most feature-packed, but in many ways they have long deviated from the original standards (possibly for the better).
Best Answer
It is very tempting to want to define the differences between BSD and Linux. Just like Gilles said in the comments, it is not an easy task since they're so numerous and disparate. Very often, the differences won't even be noticeable at the user's level; everything has been worked out so that the OS behaves as you would expect a Unix to.
Moreover multiple distributions are available for each. No matter what you say about Linux/BSD generally, you'll often find a distribution that contradicts it.
The following is a list of comparisons I found scattered over the web.
Notice the word typically in his last point. Some Linux distributions will manage source code and conversely some BSDs will manage binary packages.
--
Here are some articles describing the history of each:
Written by Dave Tyson, this article describes the history of many Unix variants (including of course BSD and Linux).
Scott Barman describes how both operating systems came to be and how it forged his opinion:
Further reading