Operating System

Updated: 2019-04-24

UNIX: "everything is a file"

Linux Flavors

  • Debian/Ubuntu:

    • Ubuntu is derived from Debian.
    • Ubuntu is a popular Desktop Linux.
    • Both use apt as package manager.
  • RedHat/CentOS:

    • RedHat is mostly for enterprise use; CentOS is the open source version.
    • Both use yum as package manager.
  • Gentoo/ChromeOS:

    • ChromeOS was originally based on Debian, but later moved to Gentoo.(if you run lsb_release -a in ChromeOS's terminal you will see Debian instead, that is because the terminal and other linux programs are actually running containers inside a VM(on KVM))


PID 0: swapper or sched, responsible for paging.


The systemd daemon serves as the root of the user space's process tree, PID 1.


  • Wayland is intended as a simpler replacement for X.
  • GNOME and KDE are expected to be ported to it.


pam - Pluggable Authentication Modules for Linux


SELinux: an implementation of Mandatory Access Control (MAC) as contrasted to the standard Unix model of Discretionary Access Control (DAC)

SELinux comes installed by default on Red Hat distributions

To check your SELinux mode, run sestatus and check the output. For example:

$ sestatus
SELinux status:                 disabled

$ sestatus
SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   enforcing

Mode from config file:          error (Success)
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Max kernel policy version:      28


  • Multi-Level Security (MLS)
  • Multi-Category Security (MCS)

Permissive vs Enforcing Mode

  • Permissive Mode: SELinux will log access control infringements but will not enforce them
  • Enforcing Mode: enforce!


TTY: teletype, now refers to any device that opens a physical or virtual terminal session.

Serial Port Terminals

Each serial port is considered to be a "device". e.g. /dev/ttys0

Pseudo Terminals

Pairs of devices such as /dev/ptyp3 and /dev/ttyp3; no physical device directly associated with either.

Controlling Terminal


SSH to a Linux server(Ubuntu)

$ tty

On a Mac

$ tty

Ubuntu PPA

PPA: Personal Package Archives

Backward Compatibility

The Linux kernel community promised that no upgrade will ever break anything that is currently working in a previous release


XDG stands for X Development Group, the old name of FreeDesktop.org.

The most famous X desktops: GNOME and KDE.


udev (userspace /dev)

/dev is static, udev is for plugable devices running in userspace.

To be able to deal with peripheral devices that are hotplug-capable in a user-friendly way, a part of handling all of these hotplug-capable hardware devices was handed over from the kernel to a daemon running in user-space. Running in user space serves security and stability purposes.