This guide explains the core concepts of Linux from a DevOps perspective. It includes users and permission management, file system navigation, package installation, system monitoring, and essential tools for daily operations. It is structured for clarity and applies directly to server maintenance, CI/CD pipelines, cloud environments, and containerized systems.
- Root User (
UID = 0): Superuser with unrestricted access. - Normal Users: Limited access, usually for human operators.
- System Users: Non-human accounts for services like
nginx,mysql.
Each file or directory has three permission sets:
- User (owner)
- Group (group members)
- Others (everyone else)
Each set uses three permission types:
rβ readwβ writexβ execute
Example from ls -l output:
-rwxr-xr-- 1 user group 1024 Jun 17 08:00 script.sh
Means:
- User:
rwxβ read/write/execute - Group:
r-xβ read/execute - Others:
r--β read-only
ls -l # View permissions
chmod 755 file.sh # rwxr-xr-x
chmod +x script.sh # Add execute
chown wahba:admin file.sh # Change owner and groupcd /var/log # Go to folder
ls -lah # Detailed list + hidden files
pwd # Show current path| Directory | Purpose |
|---|---|
/ |
Root directory |
/etc |
System configuration files |
/home |
User home directories |
/var |
Logs, caches, databases |
/usr/bin |
User commands and apps |
/bin |
Core binaries (e.g., ls, cat) |
/tmp |
Temporary files (auto-cleaned) |
/dev |
Device files (disks, input) |
/proc |
Virtual filesystem (kernel info) |
/root |
Root userβs home directory |
/boot |
Bootloader, kernel files |
sudo apt update # Refresh package index
sudo apt install nginx # Install nginx
sudo apt remove nginx # Remove nginxsudo yum update # Refresh packages (older systems)
sudo yum install httpd # Install Apache
sudo dnf install nginx # Use dnf on newer RHEL/CentOSps aux # All processes
htop # Interactive process monitor
top # Dynamic process viewkill 1234 # Gracefully stop PID 1234
kill -9 1234 # Force kill PID 1234uname -a # Kernel info
hostname # System hostname
df -h # Disk usage (human-readable)
free -m # Memory in MB
uptime # Load and uptime
whoami # Current userip a # Show all IPs
ip route # Routing tableping 8.8.8.8 # Connectivity test
curl https://google.com # HTTP GET
wget https://file.com # Download filess -tuln # Show TCP/UDP listeners
netstat -tuln # Legacy alternativetraceroute 8.8.8.8 # Network path to hostfind /etc -name "*.conf" # Find all config filesgrep "ERROR" logfile.txt # Find error lines
awk '{print $1}' file.txt # Print first column
sed 's/old/new/g' file.txt # Replace textcut -d":" -f1 /etc/passwd # Extract usernames
tee output.log # Print + write to fileadduser wahba
passwd wahba
usermod -aG sudo wahba # Give sudo accessid # UID/GID and groups
who # Who is logged in
last # Last logins| Symbolic | Numeric | Meaning |
|---|---|---|
| rwx------ | 700 | Only owner full access |
| rwxr-xr-- | 754 | Owner full, group RX |
| rw-r--r-- | 644 | Owner RW, rest read |
chmod 644 file.txt
chmod u+x deploy.shman <command>β Manual pages- Use
TABto auto-complete commands/paths - Use
!!to repeat last command history | grep sshβ Search shell historyalias ll='ls -lah'β Add to~/.bashrcfor convenience
π Author: Wahba Mousa β Senior DevOps Engineer (2025)