logo

Unix

Last Updated: 2024-01-16

Unix Philosophy: Do one thing and do it well.

"Everything is a file"

Probably the most important and defining feature of Unix. A text file is of course a file, but a directory is also a file, and a hard drive is a file, a mouse is a file, a socket is a file ...

This is super helpful for learners because everything you encounter would be a file and can be examined by commands like ls.

Unix Descendants

You will not find a modern OS named Unix, but many widely used OSes are derived from the original Unix. The largest 2 branches are BSD (including macOS) and Linux (including Android, ChromeOS).

Linux

Read more on Linux.

BSD

Read more on Linux vs BSD

  • Darwin is an open-source Unix-like operating system, derived from BSD. Apple's operating systems - macOS, iOS, watchOS, tvOS, iPadOS and bridgeOS are based on Darwin. Kernel: XNU.
  • FreeBSD
  • DragonFlyBSD: forked from FreeBSD 4.8 due to the worries that the techniques adopted for threading and symmetric multiprocessing in FreeBSD 5 would lead to poor performance and maintenance problems. DragonFly has diverged significantly from FreeBSD, implementing lightweight kernel threads (LWKT), an in-kernel message passing system, and the HAMMER file system.
  • OpenBSD: Forked from NetBSD with an emphasis on security

Minix

Minix ("mini-Unix"):

  • microkernel.
  • POSIX-compliant.
  • the underlying operating system for the ME (Intel Management Engine), which means if you have an Intel chipset in your computer, then you are running MINIX. (In addition to your main OS).
  • BSD-licensed, which means Intel can make changes to MINIX and not have to disclose those changes.
  • the world’s most privileged operating system: running on Ring -3 (negative 3). The kernel runs on Ring 0 and user applications on Ring 3 (positive 3). You have zero access to Ring -3. MINIX has total and complete access to the entirety of your computer.
  • inspire the creation of Linux.

Different From Windows

  • Unix uses / in file path, while Windows uses \

  • there's only one root directory /, so you cannot find C:\ or D:\; however other filesystems can be mounted

    $ mount # lists all mounts
    ...
    C:\ on /mnt/c type drvfs
    D:\ on /mnt/d type drvfs
    
  • Unix (or more precisely, the file systems like ext4) is case sensitive, a.txt and A.txt are two different files.

Standards

POSIX vs SUS vs LSB