NEXTDEVOPS / LINUX
Linux System Administration

Linux Operating System & CLI Reference

Essential Linux administration guide. Master file manipulation, process scheduling, memory diagnostics, systemd daemons, file permissions, and log auditing.

Linux System Architecture & Fundamentals

Linux is a Unix-like, open-source operating system kernel created by Linus Torvalds in 1991. In DevOps environments, Linux powers over 90% of global web servers, Docker container images, and cloud virtual machines due to its performance, security, and scriptability.

Kernel Layer

Manages CPU scheduling, memory allocation, device drivers, and system calls.

Shell Environment

Command-line interface (Bash/Zsh) executing scripts and binary programs.

FHS Filesystem

Standardized hierarchy (/etc config, /var logs, /home users, /tmp temporary).

Real-World Production Use Cases

1. Log Auditing & Troubleshooting

Use grep -rnw and journalctl -u nginx -f to isolate production HTTP 500 errors and OOM killer events in seconds.

2. Security & Permission Hardening

Secure SSH private keys with chmod 400 my-key.pem and configure sudoers rules to enforce least-privilege access.

3. Automated Shell Scripting

Automate database backups and cleanup cron jobs using Bash scripts combined with find and tar.

Command Syntax Visualizer

Interactive Command Syntax Explainer

Click any flag or argument below to inspect its exact production behavior and breakdown.

Linux File Management • Command Breakdown
$
Hover or click on any segment above to reveal detailed syntax explanation.

Syntax Breakdown Details

find
Command: Linux utility used to search directories recursively based on expression criteria.
/var/log
Directory Path: Root path where system log files are stored.
-type f
File Type Filter: Matches only regular files, ignoring subdirectories or symlinks.
-name "*.log"
Name Pattern: Wildcard filter matching files ending with the .log extension.
-mtime +30
Modification Time: Matches files modified more than 30 days ago (+30).
-exec
Action Flag: Executes a specific Linux command on every matched file.
rm -f {}
Action Executed: rm -f forcibly deletes each matched file represented by {}.
\;
Exec Terminator: Terminates the -exec command string in shell syntax.

Command Intent & Use Case

Finds all log files in /var/log older than 30 days and permanently removes them to reclaim disk space.

Expected Output Preview
Deleted 14 expired log files (total 3.2 GB reclaimed)
Pro Tip: Always test find commands with -print first before appending -exec rm -f.

Command Reference & Syntax

ls -la
Syntax: ls [options] [directory]

List all files and directories in detailed long format including hidden dotfiles.

Sample Output:
drwxr-xr-x  5 root root  4096 Sep 12 08:00 .
drwxr-xr-x 14 root root  4096 Sep 12 07:30 ..
-rw-r--r--  1 root root 12450 Sep 12 08:05 syslog
grep -rnw "/var/log" -e "ERROR"
Syntax: grep [options] "pattern" [path]

Recursively search for string "ERROR" line-by-line across log files.

Sample Output:
/var/log/app.log:42: [ERROR] Database connection timeout at 10.0.1.5
find /var/www -type f -name "*.sh" -exec chmod +x {} \;
Syntax: find [path] [expression] [-exec command]

Locate files matching name pattern and execute a permission change.

Sample Output:
./deploy.sh
./scripts/backup.sh
ps aux | grep nginx
Syntax: ps aux | grep [name]

Find details of active processes for Nginx HTTP server.

Sample Output:
root     1245  0.0  0.4 125400  8400 ? Ss 08:00 0:00 nginx: master process
free -h
Syntax: free -h

Display physical memory (RAM) and Swap usage in human readable MB/GB format.

Sample Output:
              total        used        free      shared  buff/cache   available
Mem:          7.7Gi       1.8Gi       4.2Gi        12Mi       1.7Gi       5.6Gi
chmod 755 script.sh
Syntax: chmod [octal-mode] [filename]

Set read, write, execute permissions for file owner and read/execute for others.

Sample Output:
-rwxr-xr-x 1 devops devops 450 Sep 12 08:10 script.sh
systemctl status nginx
Syntax: systemctl [status|start|stop|restart|enable] [service]

Check active runtime status, enabled state, and recent logs for a systemd daemon.

Sample Output:
● nginx.service - High Performance HTTP Server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled)
   Active: active (running) since Sat 2026-09-12 08:00:00 UTC
journalctl -u docker -f --since "10 min ago"
Syntax: journalctl -u [service] -f

Follow systemd log journal stream in real-time for Docker service.

Sample Output:
Sep 12 08:20:01 server docker[1245]: Container started 8a9b7c6d