The Linux Operating System contains a slew of pieces: hardware connections, partition space, boot loaders, processes, terminals, window management system...phew! It can be overwhelming to think about all these bits and pieces; let's try breaking it down to three main components.
The first piece to creating any computer is assemblying its hardware. Here are just some of the components that go into a computer:
If you're interesting in learning in much more detail about computers, try building your own PC. There's no better learning experience than being hands-on!
The kernel is the software residing in memory that takes user commands and passes them onto the hardware for execution. This is often referred to the core of the OS, as it connects hardware to the user interface and processes. We'll learn more about the kernel and its functions on the next page.
The interpreter that allows us to communicate with the kernel through commands is known as the shell. This is the lowest-level interface that a user can utilize to communicate with the computer.
There are several types of shells that you can choose from. They differ mainly in syntax and have operational features. The most common is bash which serves as the default on most machines.
A list of shells are stored in your /etc/shells file.
$ cat /etc/shells
/bin/bash /bin/csh /bin/ksh /bin/sh /bin/tcsh /bin/zsh
The shell also provides you with a list of commands and syntax that allow you to write shell scripts. Shell scripts are reuseable lines of codes a accomplish some task. Shell scripts are a good way to create programs that are portable to another Linux machines.
Lastly, we have processes (aka applications or programs), which give the kernel tasks to perform. After the user assigns or opens several processes, the kernel decides how to delegate the hardware resources to simultaneously run the programs. It is these processes and applications working in conjunction with a kernel that make up UNIX and UNIX-like Operating Systems.
At the very top-level abstraction in this system are users - entities that may own files and run processes. Each user has a username and a user id, the latter of which is used by the kernel. Groups contain sets of users.
The root user (aka superuser) is in control of the system - they are able to shut down any user processes and access any file on the system. Some adminstrative commands may only be used by the root user. To switch to root, use the
RAM (Random Access Memory) can be separated into two distinct regions - the user space and the kernel space. The main difference between the two is their privileges on operating system functions and restrictions on user applications.
The processes run by ordinary users (aka user processes) are stored in the user space. The user space is the memory that is allocated by the kernel for user processes. The separated of the user and kernel space guarantees that no user-created process steps out of bounds, which could cause system crashes or memory overflow.
The area in which processes and normal programs are run in is known as the user space. The user space is more limited to what it can access, with restrictions on memory and CPU-safe operations. A broader term encompassing this is known as sand-boxing, which restricts user programs such that they don't mess parts of memory owned by other processes. This is a good thing, as it prevents the system from crashing in case something goes haywire.
The kernel has its own special privileges that allow it access to all pieces of the CPU and memory. This area of control is known as the kernel space, which is where the kernel delegates all its tasks.
Note that the separation between user and kernel spaces allow for the computer to run smoothly and avoid any malfunctions. Additionally, anything that goes haywire in the user space can easily be fixed by the kernel.
Command Line Kung Fu is packed with dozens of tips and practical real-world examples. You won't find theoretical examples in this book. The examples demonstrate how to solve actual problems. The tactics are easy to find, too. Each chapter covers a specific topic and groups related tips and examples together.$ Check price
Programmers have to constantly learn new concepts and technologies. In this book by Andy Hunt, you'll learn how our brains are wired, and how to take advantage of your brain's architecture to make the most of your learning. You'll learn new tricks and tips to learn more, faster, and retain more of what you learn.$ Check price