Lesson 1 of 29 ↓
- 1.Rhel 9 Administration Guide
- 2.Ubuntu Boot Process Guide
- 3.Linux Basic Commands Guide
- 4.Comprehensive Unix Shells Guide
- 5.Mastering Vim Deep & Practical Guide
- 6.Magic Numbers in Linux Deep Systems Guide
- 7.Wildcards & Globbing in Linux Deep Cli Guide
- 8.Linux Users & Groups Deep Administration Guide
- 9.Journaling in Linux Filesystems Deep Systems Guide
- 10.Getopt & Getoptlong Deep System-level Option Parsing Guide
- 11.Su Command in Linux Complete Guide with Environment Variables
- 12.Linux File Permissions and Ownership Complete Practical Guide
- 13.Ubuntu Package Management Apt Complete Guide
- 14.Bash Scripting Basics
- 15.Linux File System Essentials
- 16.Process and Thread Management
- 17.Session 10 : Introduction to Networking & the Application Layer
- 18.Linux Networking Cli & Introduction to Yocto for Machine Routing
- 19.Comprehensive Guide to Ssh (secure Shell)
- 20.Logical Volume Management (lvm) Guide
- 21.C Build Process & Libraries Guide
- 22.Archiving and Compression in Linux
- 23.Linux Package Managers: a Detailed Guide
- 24.Misra-c Guidelines Detailed Cheat Sheet
- 25.Mqtt Server Setup (pc as Server)
- 26.Detailed Explanation of Tty and Pts in Linux
- 27.Vim Cheat Sheet
- 28.Difference Between apt and apt-get
- 29.Difference Between apt Upgrade and apt Full-upgrade
6 min read
Rhel 9 Administration Guide
A comprehensive summary of Red Hat Enterprise Linux 9 administration topics, including architecture, command-line basics, file systems, user management, services, and process monitoring.
Introduction to Linux
Why Learn Linux?
-
Community support
-
High Security & Stability
-
Ease of Maintenance
-
Open Source & Free
-
Runs on any hardware
-
Customization & Flexibility
Linux Distributions
There are multiple distributions (distros), each with different release policies and support models:
-
RHEL (Red Hat Enterprise Linux): Industry standard for enterprise.
-
CentOS Stream
-
Fedora
-
Ubuntu
-
Debian
Linux Architecture
The Linux operating system consists of layers:
-
Hardware: Physical devices.
-
Kernel: The core that interacts directly with hardware (drivers, memory, processes).
-
Shell: The interface (like Bash) that takes user commands and passes them to the kernel.
-
Applications: User-level programs and libraries.
The Shell (bash)
-
Normal User (
$): Standard privileges (e.g.,username@hostname:~$). -
Root User (
#): Administrative (superuser) privileges (e.g.,root@hostname:~#). -
Case Sensitivity: Linux commands and filenames are case-sensitive.
-
Syntax:
command option(s) argument(s)-
Right:
ls -l /dev -
Wrong:
ls - l /dev(spaces matter)
-
Basic Operations & Shortcuts
Gui vs Cli
-
GUI (Graphical User Interface): User-friendly, point-and-click.
-
CLI (Command Line Interface): Powerful, scriptable, resource-efficient, and friendly for remote access.
Remote Access (ssh)
Remote administration is usually performed over SSH (Secure Shell) for encrypted connections.
- Syntax:
ssh user@host
Basic Commands
| Command | Description |
|---|---|
date |
Display system date and time |
cal |
Display a calendar |
passwd |
Change user password |
file |
Determine file type |
cat |
View file contents |
less / more |
View file contents page by page |
head / tail |
View beginning/end of files |
history |
View command history |
ls |
List directory contents |
id |
Print user and group IDs |
clear |
Clear terminal screen |
exit |
Exit the shell |
Reading Manual Pages
-
man command: Shows the full manual page. -
command --help: Often provides a quick usage summary.
Terminal Shortcuts
-
Ctrl+A: Jump to the beginning of the line.
-
Ctrl+E: Jump to the end of the line.
-
Ctrl+U: Clear from cursor to beginning.
-
Ctrl+K: Clear from cursor to end.
-
Ctrl+Left/Right Arrow: Jump between words.
-
Ctrl+R: Search history (reverse-i-search).
-
Tab: Auto-completion.
Vim Editor
Vim has three main modes:
-
Command (Normal) Mode: Navigate and issue commands.
-
Insert Mode: Edit text.
-
Visual Mode: Select text.
Common Commands:
-
vim file.txt: Open file. -
i: Switch to Insert mode. -
:wq: Save and quit. -
:q!: Quit without saving.
File System Hierarchy & Management
Directory Structure
Linux uses a single directory tree starting at /.
-
/bin&/usr/bin: Essential user binaries. -
/sbin&/usr/sbin: System binaries. -
/boot: Boot loader files. -
/dev: Device files. -
/etc: System configuration files. -
/home: User home directories. -
/root: Root user's home directory. -
/run: Runtime data (processes started since boot). -
/tmp: Temporary files (deleted automatically after 10 days). -
/var: Variable data (logs, websites, databases). -
/proc: Kernel and process information (virtual filesystem). -
/sys: Kernel sysfs (device and driver info).
Types of Files
-
Regular files
-
Directories
-
Device files
-
Symbolic links
-
Sockets
-
FIFOs (pipes)
File Management Commands
| Command | Usage |
|---|---|
touch |
Create empty files or update timestamps |
mkdir |
Create directories |
cp |
Copy files or directories |
mv |
Move or rename files |
rm |
Remove files |
rmdir |
Remove empty directories |
Paths
-
Absolute Path: Starts from root
/(e.g.,/home/user/Documents). -
Relative Path: Starts from current location (e.g.,
./file.txt,../dir/).
Links
-
Hard Link (
ln source target): Exact replica, shares Inode, valid only within the same filesystem. -
Soft Link (
ln -s target linkname): Pointer/shortcut to original file, different Inode, can cross filesystems.
Searching & Redirection
Pattern Matching (globbing)
-
*: Matches zero or more characters (e.g.,*.txt). -
?: Matches exactly one character (e.g.,file?.log). -
[abc]: Matches any one character in the set. -
[!abc]: Matches any character NOT in the set.
Grep Command
Used to search text/patterns within files.
-
grep 'pattern' filename: Basic search. -
grep -i: Case insensitive. -
grep -v: Invert match (show lines NOT matching). -
grep -r: Recursive search. -
grep -n: Show line numbers. -
grep -A3/-B3: Show 3 lines after/before match.
I/o Redirection & Pipelines
-
>: Redirect standard output to a file (overwrite). -
>>: Redirect standard output to a file (append). -
2>: Redirect standard error. -
&>or2>&1: Redirect both output and error. -
|(Pipe): Pass output of one command as input to the next (e.g.,ps aux | grep sshd).
User & Group Management
User Accounts
-
UID (User ID): Unique identifier.
-
Root: UID 0.
-
System Users: Low UIDs (reserved).
-
Regular Users: Higher UIDs (defined in
/etc/login.defs).
-
-
Configuration Files:
-
/etc/passwd: User account info (username, UID, GID, home, shell). -
/etc/group: Group definitions.
-
Privilege Escalation
-
su: Switch user.su - usernameswitches to user with login shell.su -switches to root. -
sudo: Execute a command as another user (usually root) using your own password.- Configured in
/etc/sudoers(edit usingvisudo).
- Configured in
User Creation
-
useradd [options] username: Creates user and home directory. -
passwd username: Set the password. -
usermod: Modify existing user properties.
Nologin Shell
Service accounts often use /sbin/nologin or /usr/sbin/nologin as their shell to prevent interactive login access for security.
Permissions
Permissions govern access to files and directories (Read r, Write w, Execute x).
Methods
-
Symbolic:
u(user),g(group),o(others).-
Example:
chmod u+x script.sh(Add execute for owner). -
Example:
chmod g-w file.txt(Remove write for group).
-
-
Numeric:
-
Read = 4, Write = 2, Execute = 1.
-
Example:
chmod 755 dir(rwx for owner, rx for others). -
Example:
chmod 644 file(rw for owner, r for others).
-
Ownership
-
chown owner:group filename: Change user and group ownership. -
chown -R: Recursive change.
Process Management & Logging
Process Monitoring
-
Process ID (PID): Unique ID for every running process.
-
ps: Snapshot of current processes.ps auxorps -ef: View all processes.
-
top/htop: Real-time system monitoring. -
pstree: View processes as a tree structure. -
pgrep: Find process IDs by name.
Job Control
-
jobs: List background jobs. -
fg: Bring job to foreground.
Killing Processes
-
kill [PID]: Send TERM signal. -
kill -9 [PID]: Force kill (KILL signal). -
pkill [name]: Kill by process name. -
killall [name]: Kill all processes with specific name.
System Logging
Logs are primarily in /var/log (e.g., /var/log/messages).
-
Priorities: emerg, alert, crit, err, warning, notice, info, debug.
-
Viewing:
-
tail -f /var/log/messages: Follow log in real-time. -
less +F: Also allows following.
-
Journalctl
Query the systemd journal:
-
journalctl -u nginx.service: Logs for a specific unit. -
journalctl -f: Follow live logs. -
journalctl --since "2025-06-01": Filter by time.
Service Management & Time Configuration
Service Management (systemctl)
Manage systemd services (start, stop, restart, enable).
-
systemctl status nginx: Check status. -
systemctl start nginx: Start service. -
systemctl stop nginx: Stop service. -
systemctl enable --now nginx: Enable service at boot and start it immediately. -
States: active, inactive, failed.
Time Configuration
Manage system time and timezone.
-
timedatectl status: Check current settings. -
timedatectl set-timezone Region/City: Set timezone (e.g.,Africa/Cairo).
Software Management
RHEL family uses yum (or dnf) and rpm for package management.
Yum/dnf (high-level)
-
yum search package: Search repositories. -
yum install package: Download and install. -
yum update: Update packages.
Rpm (low-level)
rpm -ivh package.rpm: Install a local RPM file with verbose output and hash progress.
References
-
Red Hat Documentation: docs.redhat.com
-
The Linux Documentation Project: tldp.org
-
Local Help:
/usr/share/doc,manpages.
Comments
Loading the discussion…