Linux 101
What Linux is?
So Linux is a unix-like operating system (just like the windows OS), except that Linux is an open-source kernel first created in 1991 by Linus Torvalds, which powers various linux distributions (distros) like Ubuntu, CentOS, Fedora, e.t.c. Now, kernel is a popular word which gets thrown around daily and used ambiguously when referring to any linux based system or distro but the kernel is analogous to the engine of a car which is just a part of the car, albeit a very imperative and core part of the entire car system. Distros are just flavours of cars like Honda, Toyota and various other car brands which come with extra parts like different car body shapes, car seats, sound systems and various other parts which make a car feel complete to a user. In the case of the Linux kernel and distros, the linux kernel is basically the core code responsible for resource management, CPU scheduling, system calls, process management and other core functionalities while the distros add various other parts like the package managers, pre-installed applications, Graphical User Interface e.t.c. You can check which kernel version a particular distro runs on using the uname -r command. In my case, when the command is run on a centOS machine, the output is 6.12.0–170.el10.aarch64. The 6 refers to the primary Kernel version, 12 refers to the major version, 0 is the minor version, 170 is the patch level and the remainder suffix are details specific to a particular distribution which varies across distros.
The Kernel code runs in what is called the Kernel space and has unrestricted direct access to hardware and other low-level parts of the entire system. On the flip side, we have the User space where any non-kernel code runs without direct access to system resources. If the processes in the user space need to open a file or access some resource on the system, a system call is made which is essentially a block of code in the kernel code responsible for executing the particular system call made ( examples are open(), close() file and various others ).
In effect, the Kernel code is basically a monolith and modular set of instructions responsible for executing system calls, managing applications, processes, memory and scheduling execution time for these processes on the CPU ( all these are system resources and the kernel is basically a resource manager ).
What Happens when you start a linux system?
The process of starting (or restarting) a computer is called Booting and the linux boot process comprises of 4 steps or sequences (usually called the linux boot sequence).
- BIOS POST — BIOS is an acronym for Basic Input/Output System and POST means Power-On Self Test. This part of the sequence although not exclusive to Linux is responsible for checking and ensuring all hardware components on the system are in the right state before attempting anything else. If the BIOS POST check fails, the boot process does not proceed with the other steps of the boot sequences.
- Boot Loader — Once the BIOS POST check passes, the BIOS loads and executes the boot code located at /boot. A popular boot loader is the GRUB2 (GRand Unified Bootloader which is a bootloader from the GNU project). The boot loader provides the user with the kernel selection graphical menu especially in cases of multi-OS systems where the disk has been partitioned to accomodate multiple OSes (like Ubuntu and Windows on the same system). Once the kernel is selected, the boot loader loads the kernel (which is usually in a compressed form) into memory, supplies some necessary parameters to it and surrenders control to the kernel.
- Kernel Initialization — Once the kernel is loaded, it is uncompressed and the kernel initialization executes. The kernel init basically initializes all hardware, memory management, scheduling and various other essential core functionalities. Once this is done and the kernel is completely operational, the kernel looks for an init process to run which is usually systemd on most distributions (you can check this by running ls -l /sbin/init).
- SystemD Init Process — The systemd init process initializes the user space applications, processes, mounts filesystems and anything else necessary to bring the entire system to a completely viable or useable state.
Linux FileSystem and File Types
Get Adebiyi Akintunde’s stories in your inbox
Join Medium for free to get updates from this writer.
While not completely accurate, a popular core principle or paradigm of linux which was inherited from Unix is the “Everything is a file principle” and this just means many components and resources on the linux system can be treated as files or file-like objects, which implies they can be operated on using the normal I/O tools and system calls. Linux has various file types such as regular files, directories, sockets, links, pipes, devices e.t.c. The file command with the name of the file passed in can be used to determine the type of a file. Another method is to use the ls -l with the name of the file as argument. The first letter of the output ls -l <file or directory name> command gives the file type as a symbol. s — for sockets which are used for process communications, d for directories “—” for regular files, p for pipes, | for links, b for blocks e.t.c The entire file system comprises many directories starting from “/”.
/home — Contains the home directories for all users on the system except the super user’s home directory (root user), which is stored in /root
/opt — Is used to store third party software
/mnt — Is used for mounting file systems temporarily to the system.
/tmp — This can be used to hold temporary files copied from the mounted file system for purposes such as installation of packages and after installation, the files in this directory is removed alongside removal of the mounted file system.
/media — This is where external media (like usb, e.t.c) is mounted on.( Use df -pH to check where the media devices on the system are mounted on)
/dev — Contains files for devices mounted on the file system.. usually referred to in the /media file and various other parts of the file system.
/etc — Holds configuration files.
/bin — Holds files for commands ( cp, mv, ls, mkdir )and other binaries.
/lib — Contains shared libraries which can be imported into programs.
/var — The system writes data like logs, errors and various other system data here.
/usr — User space applications ( like chrome, firefox, email clients e.t.c )reside here.
Hopefully this intro gives some perspective on what linux is and how linux operates.



