This week’s classes kicked off with our usual revision session, you can catch up on it here Afterwards, we dove straight into Linux process management (and more). Let’s take a look!
Linux Process Management
In Linux, everything that runs from your web browser to background services is a process. Each process is an instance of a running program, assigned a unique Process ID (PID).
Linux provides powerful tools to manage processes:
- ps (Process Status): Lists currently running processes.
ps aux | grep nginx
Shows all processes related to nginx.
- top / htop: Monitors system resources and active processes in real time.
top
Displays CPU, memory usage, and active processes.
- kill: Terminates processes by PID.
kill -9 1234
Forcefully ends process with PID 1234
.
- systemctl: Manages system services (e.g., Apache, Docker).
sudo systemctl restart apache2
Real-world Example:
On a production web server, if your database service crashes, you can use systemctl status mysql
to check if it’s running and restart it with systemctl restart mysql
.
Linux File System
Unlike Windows, which uses drives labeled C:
, D:
, etc., Linux organizes everything under a single hierarchical directory tree starting at /
(root).
Key Directories in Linux File System:
/home
→ User files and personal directories/etc
→ Configuration files/var
→ Logs and variable data/bin
→ Essential binaries (commands likels
,cp
,mv
)/usr
→ Installed applications and libraries
Example:
If you want to edit the configuration for the SSH service, you’ll find it in:
/etc/ssh/sshd_config
This structured layout ensures consistency across all Linux distributions.
Virtual Storage
Linux abstracts physical storage devices into virtual storage, allowing multiple devices to be combined, partitioned, or formatted flexibly.
Block Devices: Physical devices (e.g.,
/dev/sda
,/dev/nvme0n1
).Partitions: Logical subdivisions (e.g.,
/dev/sda1
).File Systems: Structures like
ext4
,xfs
, orbtrfs
applied to partitions.
Example:
A cloud server with one physical disk /dev/sda
can be split into partitions:
/dev/sda1
→ Root filesystem (/)/dev/sda2
→ Swap space/dev/sda3
→ /home directory
This flexibility makes Linux ideal for servers and enterprise setups.
Mounting Storage
Linux doesn’t automatically assign drive letters to devices. Instead, mounting is used to attach a storage device to the file system hierarchy.
Mounting a USB Drive Example:
- Plug in the USB, identify it:
lsblk
Output might show /dev/sdb1
.
- Create a mount point:
sudo mkdir /mnt/usb
- Mount the device:
sudo mount /dev/sdb1 /mnt/usb
Now you can access the USB’s files at /mnt/usb
.
To unmount:
sudo umount /mnt/usb
Real-world Example:
Sysadmins mount external drives or network storage for backups or file sharing across teams.
Application Package Management
Installing software in Linux is typically done through package managers, which handle downloading, installing, updating, and removing applications. This ensures software is pulled from trusted sources.
Popular Package Managers:
- APT (Debian/Ubuntu):
sudo apt update && sudo apt install nginx
- YUM/DNF (CentOS, Fedora, RHEL):
sudo dnf install nginx
- Pacman (Arch Linux):
sudo pacman -S nginx
Instead of downloading .exe
files (as in Windows), Linux distributions maintain curated repositories.
Package Index and Package Manager
A package index is the catalog of software available for a Linux distribution. The package manager queries this index to fetch and install packages.
For example, in Ubuntu:
- The package index is updated with:
sudo apt update
- Then you can install software like:
sudo apt install python3
Real-world Example:
If you’re setting up a web server, you’ll use a package manager to install services like Nginx, PostgreSQL, or Docker all managed securely from the distribution’s repositories.
Why These Concepts Matter
Process Management → Keeps applications running smoothly and prevents resource hogging.
File System & Virtual Storage → Provides structured, flexible data management.
Mounting → Ensures external devices and partitions integrate seamlessly.
Package Management → Simplifies software installation and security updates.
Everyday Scenario:
A DevOps engineer might monitor a process with top
, mount a new EBS volume in AWS, format it with ext4
, and then use apt
to install Docker all in a day’s work.
Linux is not just an operating system; it’s a finely tuned ecosystem of processes, files, storage, and package management. Understanding these fundamentals gives you a deeper appreciation for its design and empowers you to manage Linux systems effectively.
I’m Ikoh Sylva, a passionate cloud computing enthusiast with hands-on experience in AWS. I’m documenting my cloud journey from a beginner’s perspective, aiming to inspire others along the way.
If you find my content helpful, please like and follow my posts, and consider sharing this article with anyone starting their own cloud journey.
Let’s connect on social media. I’d love to engage and exchange ideas with you!
Top comments (0)