Operating Systems
A. Windows vs. Unix
Server operating systems can be broadly grouped into two major families:
- Windows-based systems e.g. Windows Server
- Unix / Unix-like systems e.g. Linux, BSD, Solaris
Although there are many OS names, server operating systems are mainly concentrated around a few major families. Consumer machines may run Windows 11, macOS, etc., but servers usually run Linux or Windows Server.
B. Linux & Linux Distributions
Linux is a Unix-like operating system kernel and is extremely common in server environments. A Linux distribution combines the Linux kernel with system utilities, package management, and other software to form a complete operating system.
Linux has many different distributions (distros), including:
They share the Linux kernel but package and configure the surrounding system differently for different purposes.
The instructor emphasizes that Linux is:
- accessible
- customizable
- equipped with many useful command-line tools
That's why there are Linux distributions for many different use cases. For example, Ubuntu is a Linux distribution that is designed to be user-friendly and easy to use, while CentOS is a Linux distribution that is designed for enterprise environments.
So: Linux ≠ Ubuntu, Ubuntu is a Linux distribution.
C. Why Ubuntu?
For this course, the server runs Ubuntu, specifically an LTS version.
The instructor describes Ubuntu as a safe general-purpose choice:
"Ubuntu is always a safe bet. You can't go wrong going with Ubuntu."
For this course:
We don't need to learn every Linux distribution. The goal is to learn common Linux/Unix concepts and use Ubuntu as our working server environment.
D. Why Unix Commands Work Across Systems
Many commands and tools work similarly across Unix and Unix-like environments.
The instructor summarizes this as:
"Because the root is Unix."
This is a teaching shortcut rather than a literal description. Linux is Unix-like, not a direct copy of the original Unix source code. Commands work similarly across these systems because they share Unix design conventions and standards such as POSIX, although GNU, BSD, and other implementations may differ in their available options.
Examples:
ls
cd
mkdir
rm
The important part is not just memorizing individual commands.
We are learning a common Unix-style way of interacting with an operating system.
E. Three Parts of a Unix Operating System
The instructor breaks a Unix operating system into three major parts:
- Programs / Utilities
- Shell
- Kernel
Conceptually:
Programs / Utilities
Programs and utilities are the tools available inside the operating system.
Examples include:
ls
rmdir
vi
These commands are programs/utilities installed in the operating system rather than special instructions understood directly by the hardware.
Shell
The shell is the environment through which users interact with the operating system.
We enter commands into the shell, and the shell allows us to execute programs and interact with the system.
Kernel
The kernel is the low-level core of the operating system.
It sits between software and hardware and handles interaction with the underlying hardware.
Key idea: Programs are the tools we use, the shell is where we interact with the system, and the kernel handles lower-level interaction with hardware.
F. Shell vs. Kernel
As software engineers, we mainly work in the shell / user land rather than directly with the kernel.
The instructor says:
"We're not going kernel deep. We're staying at the shell in the user land."
What we care about
As full-stack engineers, we mainly work with:
- Shell
- Linux commands
- Files
- Processes(The programs that are running on the system.)
- Permissions (The access control for files and processes.)
- SSH (Secure Shell, a protocol for securely accessing remote servers.)
- Server configuration (Setting up and managing the server environment, including software installation, network settings, and security configurations.)
What is not the focus
We generally don't need to go deeply into:
- Kernel internals
- Hardware drivers
- Low-level OS implementation
Those topics are closer to operating systems and computer engineering.
For a full-stack engineer, the goal isn't:
"I need to understand how the Linux kernel is implemented."
Instead:
"I need to understand how to operate and reason about the Linux environment where my application runs."
G. Unix Core Model: Files & Processes
Files and processes are two core concepts when operating a Unix-like system:
- File: stored data or programs.
- Process: a program that is currently running.
Example:
This distinction becomes important later when working with servers because we often need to:
- Find running processes
- Start processes
- Stop processes
- Inspect processes
Key idea: A program exists as a file; when it is executed, it runs as a process.
H. POSIX & Standard Streams
Unix utilities follow common standards and conventions such as POSIX, which is the abbreviation for Portable Operating System Interface. It is a set of standards that define how Unix-like operating systems should behave.
One important convention is that programs communicate through standard streams.
Unix programs commonly use three standard streams:
- stdin (Standard Input): input received by a program
- stdout (Standard Output): normal output produced by a program
- stderr (Standard Error): error output produced by a program
A pipe (|) connects the stdout of one command to the stdin of another command.
For example:
printf '%s\n' * | grep '\.js$'
Conceptually:
It means that printf sends the directory entries through stdout to the stdin of grep, which filters the results to lines ending in .js.
This allows Unix to use many small tools that each do one job and combine them to perform more complex operations.
Key idea: Unix tools are powerful because programs can communicate through standard streams and be chained together with pipes.