UNIT 7: User & Process Management
A Linux system is a busy factory. Users are the workers, and Processes are the machines running 24/7.
1. Managing Humans (Users)
Every Linux system has a "God" user called root. You should never log in as root for daily tasks.
Instead, create regular users and give them temporary power.
sudo useradd -m alice # Create user 'alice' with a home folder
sudo passwd alice # Set alice's password
sudo deluser alice # Fire alice (Delete user)
sudo passwd alice # Set alice's password
sudo deluser alice # Fire alice (Delete user)
2. Sudo (SuperUser DO)
If you try to install software, Linux will block you. You must say the magic word:
sudo command
This temporarily upgrades your permission to Root level for one command only.
3. Managing Machines (Processes)
Every program running on Linux is a Process. Every process has a unique number called a PID (Process ID).
Viewing Processes
top # Shows a live Task Manager (CPU/RAM usage)
ps aux # Lists every single process running right now
ps aux # Lists every single process running right now
Killing Processes
When a program crashes or freezes, you don't restart the computer. You kill the process.
kill 1234 # Terminates process with PID 1234
kill -9 1234 # "Force Kill" (The nuclear option)
kill -9 1234 # "Force Kill" (The nuclear option)
MISSION: A 'rogue_ai' is eating 99% CPU. Find its PID and kill it.
root@learnix:~#