⚙️ Applications in Linux
🔹 How Applications Run
Every application, when executed, creates a process with:
- A unique Process ID (PID)
- Allocated CPU and RAM
🔸 Types of Applications:
1. Executables
- Applications started manually from the command line
- A process is created only when run
- Example: Classroom software, command-line tools
2. Daemons / Services
- Background processes that provide long-running services
- Common for server applications (e.g.,
sshd
,httpd
,postgres
) - Can be enabled to start automatically on boot
🔧 Managing Services (Daemons)
Use the
systemctl
command (available in all modern Linux distributions) to:- Start / Stop / Enable / Disable / Check status of daemons
Example:
sudo systemctl start apache2 sudo systemctl enable apache2 sudo systemctl status apache2
📦 Installing Applications in Linux
1. Build from Source Code
- Compile source code manually using tools like
make
,gcc
Example workflow:
./configure make sudo make install
2. Using Packages
a. Debian-Based:
- Use
.deb
files Tools:
dpkg
,apt
- Example:
sudo apt install tree
- Example:
b. Red Hat-Based:
- Use
.rpm
files Tools:
rpm
,dnf
- Example:
sudo dnf install tree
- Example:
3. Package Managers
- Handle dependencies, repositories, and updates
- Debian:
apt
- Red Hat:
dnf
(oryum
in older versions)
🖥️ Linux Boot Process – What Happens When Linux Starts?
BIOS/UEFI
- Initializes hardware and checks components
Bootloader (GRUB)
- Loads the OS kernel into memory
Kernel
- Allocates memory and starts the first process
Init System (e.g., systemd)
- The first process (
PID 1
) - Responsible for starting all other system services and processes
- The first process (
Daemons and User Sessions
- Daemons like networking, logging, SSH, etc., are loaded
- Eventually, user sessions (GUI or terminal) are made available
👤 Users and Groups in Linux
🔑 Special User Groups:
sudo
group (Debian/Ubuntu):- Members can use
sudo
to run commands with elevated (root) privileges
- Members can use
wheel
group (Red Hat/CentOS/Fedora):- Equivalent to
sudo
group, used for privilege escalation viasudo
- Equivalent to
🏠 Home Directory:
- User's personal directory:
/home/<username>
- Users have read/write/execute permissions here
Example:
cd /home/john
⚠️ Root User:
- Has access to all files and commands
- Home directory is
/root
📂 Linux Folder Structure Overview
Directory | Purpose |
---|---|
/ |
Root of the entire file system |
/home |
Home directories for users |
/root |
Home directory for the root user |
/etc |
Configuration files |
/bin |
Essential binary executables |
/sbin |
System binaries (root/admin tools) |
/usr |
User-installed applications and files |
/var |
Variable files like logs, databases |
/tmp |
Temporary files |
/dev |
Device files |
/proc |
Virtual filesystem with process info |
/lib |
Shared libraries needed by binaries |