Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Hot answers tagged

55

Market forces. There are many more programs targeted specifically at Linux than at *BSD. A lot of software source code is portable enough that it can be compiled on both, but many software producers that ship Linux binaries do not bother to do so for the BSDs since they have smaller market shares than Linux, across the board.¹ If a piece of software is ...


50

I don't think I will provide you and everyone with the perfect answer, however, using a BSD system everyday for work, I am sure I can give you a useful insight in the BSD world. I didn't ever use NetBSD, I won't talk a lot about it. Do they use the same kernel? No, although there are similarities due to the historic forks. Each project evolved separately....


41

Linux is a kernel. It does not have the code for applications programs in the first place. Linux-based operating systems do not even necessarily use the same source code as one another, let alone the same code as on the BSDs. There are famously multiple implementations of several fairly basic programs. These include, but are not limited to: ifconfig had ...


39

No, kernels from different implementations of Unix-style operating systems are not interchangeable, notably because they all present different interfaces to the rest of the system (user space) — their system calls (including ioctl specifics), the various virtual file systems they use... What is interchangeable to some extent, at the source level, is the ...


31

The traditional BSD hexdump utility uses the platform's endianness, so the output you see means your machine is little-endian. Use hexdump -C (or od -t x1) to get consistent byte-by-byte output irrespective of the platform's endianness.


30

That is a difficult question to answer. First "Unix Like" or "*nix" usually means POSIX. All the systems you listed are POSIX systems. POSIX is a set of standards to implement. Now for the harder questions. GNU isn't really an OS. It's more of a set of rules or philosophies that govern free software, that at the same time gave birth to a bunch of tools ...


29

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 ...


27

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-...


24

I have never seen +a, only something like chmod a+r which means "add read permissions to all users" (owner/user, group, others). From man 1 chmod: The format of a symbolic mode is [ugoa...][[+-=][perms...]...], where perms is either zero or more letters from the set rwxXst, or a single letter from the set ugo. Multiple symbolic modes can be given, ...


22

1. What are the conceptual and structural differences between a Linux-Kernel and a BSD-kernel? Regarding architecture and internal structures, there are of course differences on how things are done (ie: lvm vs geom, early and complex jail feature for FreeBSD, ...), but overall there are not that much differences between the two: BSD* kernel and Linux ...


21

You are comparing kernel and whole systems. Kernels are just the main central piece of a system, but not all of it. In fact there is no such thing as a Linux system per se, but there are countless "Gnu/Linux" or other Linux Kernel based systems (one being Android). Linus Torvalds choose to concentrate his work on the central piece and successfully manage ...


17

Pretty much all Linuxes use GNU versions of the original core Unix commands like ps, which, as you've noted, supports both BSD and AT&T style options. Since your stated goal is only compatibility among Linuxes, that means the answer is, "It doesn't matter." Embedded and other very small variants of Linux typically use BusyBox instead of the GNU tools, ...


16

(I can't give a complete answer, but I also can't turn away from this question, so...I'll just address some points...FreeBSD was the most used BSD (in 2005), so I try to offer some clues regarding "the others".) First of all, you're right to dismiss the one-line explanations, OpenBSD's motto is "free, functional and secure" and the NetBSD developers also ...


16

Well, first off, you speak of BSD as if they're is only one. Technically, I suppose, there is the original one they were all derived from—last release was in 1995. Searching for "4.4-Lite2" finds several copies, you can find out more about it at the Wikipedia's Berkeley Software Distribution article. Derived from it are—among many things*—FreeBSD, OpenBSD, ...


15

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 ...


15

BSDTAR vs TAR plus much more Here is one benefit!! I'm going to go into 5 topics here (and go way off topic, but it will cover what you want as well): bsdtar vs tar sparse files vs not thick and thin files/luns with btrfs thick and thin files/luns without btrfs diff between thick and thin and how it doesn't apply to just luns bsdtar handles sparse ...


14

Linux is not an OS, it's a kernel. Linux by itself has no 'userland' environment (no apps, no commands, no ...etc...). If you want to have a complete OS, you have to add an userland to your kernel. Historically, for Linux, it's GNU. All(?) Linux distributions are not 'real Linux' distributions. They are GNU/Linux (GNU + Linux) distributions. BSD is a 'unix-...


13

From the Ubuntu package description (http://packages.ubuntu.com/de/lucid/bsdtar) "The bsdtar program has a number of advantages over previous tar implementations: Library. Since the core functionality is in a library, it can be used by other tools, such as pkg_add. Automatic format detection. Libarchive automatically detects the compression (none/gzip/...


13

OpenBSD and your VM are working right; you are mis-using the Google time source. This is in the OpenBSD Frequently Asked Questions and manual pages. You are synchronizing to a time source that publishes UTC time, sort of. But by default rdate assumes that your time source publishes TAI-10 time. TAI, a strict uniformly increasing count of all SI seconds ...


13

Are these programs in Linux and BSD the same? The short answer is: Not necessarily. The source code of common programs such as ls, cat, echo, kill, etc. depend on what userland they come from. In other words, the userland your system uses. The most common userland used with the Linux kernel is GNU - hence the name GNU/Linux. Other userlands have been ...


12

I've found a solution on my own by deep reading man lsof. (Yes, RT*M still helps.) Thanks @Gilles for aiming. Here is the solution: lsof -aPi -p 555 (555 is the PID). Explanation: -p to specify the PID number; -i to display only network devices; -a to AND two conditions above (otherwise they will be ORed); -P to display port numbers (instead port names by ...


12

There are a number of implementations, e.g. Mattias Andrée's sha3sum, or the Perl Digest-SHA3 module. In Debian, install libdigest-sha3-perl; in Fedora, install sha3sum; both of these will provide a sha3sum command based on the Perl module, which behaves in the same way as the binaries you're used to.


11

There are literally hundreds of different Linux-based systems, compared to a handful of BSDs (and a somewhat larger number of propietary Unix systems). Some speculate that the coherence of the Linux kernel (all Linux systems share more or less the same kernel; there are variants, like Android's, or more or less severely patched "enterprise" systems, but ...


10

There is no correlation between the number of processes and the “clarity” of an operating system. You are comparing apples and gooseberries. On a Linux system, ps ax will show a lot of processes that consume no memory and have a name in square brackets, like this: root 2 0.0 0.0 0 0 ? S Nov02 0:01 [kthreadd] root 3 0....


10

I just can give you an overall answer: Command line options are often parsed using the library function getopt. Originally it only accepted arguments consisting of a - followed by a symbol. This effectively limits the amount of options you have, more or less -A to -Z, -a to -z and -0 to -9. You can imagine that you will not use an option without at least a ...


10

Login classes has been a part of FreeBSD for as long I can remember. It allows the system administrator (root) to set resource constraints for users, or a group of users as configured in /etc/login.conf. This is particularly useful on multi-user servers such as webhosting and shell providers. These kind of constraints involves: CPU utilization Memory ...


9

The only reliable way to write scripts that support different operating systems is to only use features that are defined by POSIX. For things like your personal shell configurations, you can use hacks that fit your specific use case. Something like the following is ugly, but will accomplish the goal. if ls --version 2>/dev/null | grep -q 'coreutils'; ...


9

On some Unix-style systems (BSDs and macOS), CtrlT sends SIGINFO to the running process. Some commands handle this directly; otherwise, it’s handled by the kernel, and that’s what produces the output you’re seeing. SIGINFO on GNU Linux (Arch Linux) missing has more on the topic.


Only top voted, non community-wiki answers of a minimum length are eligible