The daily routine of a Linux system administrator has remained fundamentally unchanged over the past thirty years: managing users, monitoring disk space, overseeing services, reviewing logs, troubleshooting performance, and conducting security audits. What truly sets apart high-efficiency administrators is their choice of commands—whether they stick to legacy tools like `ls`, `cat`, and `grep -r`, or leverage modern CLI toolchains and the native capabilities of `systemd`. The following 14 sets of commands cover high-frequency tasks, with each entry explaining the rationale behind its use and providing actionable logic for when to apply it.
Searching and Viewing: Reclaiming Time Lost to I/O
Traditional tools like `grep -r` and `find` are often so slow when navigating large directories or codebases that they become practically unusable. `ripgrep` (`rg`) automatically skips hidden files, binaries, and entries listed in `.gitignore`; it is typically 10 to 100 times faster than `grep` and features intelligent case-sensitive matching. When tracking down configuration issues, `rg -C 2 "error" /etc/` provides immediate context, eliminating the need to chain `grep` with `sed`. Similarly, `fd` replaces the cumbersome flag combinations required by `find`: use `fd --changed-within 1h` to locate files modified in the last hour, or `fd -e conf /etc` to filter by file extension—all with color-coded output and automatic exclusion of hidden directories. `bat` enhances the standard `cat` command by adding syntax highlighting and Git integration, making the structure of files like `/etc/nginx/nginx.conf` or `systemd` unit files instantly clear. If you only adopt one habit, add `alias grep='rg'` and `alias cat='bat'` to your `~/.bashrc`; you’ll retain your existing muscle memory while gaining a significant leap in operational efficiency.
Services and Logs: Moving Beyond Blind `tail -f`
On modern Linux distributions, service management has been consolidated under `systemd`. Use `systemctl list-units --type=service --state=running` to quickly identify which services are currently active, and `systemctl status <svc>` to gain an immediate overview of recent logs and exit codes. Regarding logs, using `journalctl -u <svc> -f` is far more reliable than guessing filenames under `/var/log`. If a service is repeatedly restarting, `journalctl -u <svc> -n 100 --no-pager` allows you to pull the last 100 lines directly, bypassing the need for a pager tool. For disks and mount points, `lsblk -f` provides a comprehensive view—showing partitions, file system types, UUIDs, and mount points—while `findmnt` displays the hierarchy of what is mounted where. Together, these tools can answer the question "Is this disk actually mounted?" in under a minute.
For performance diagnostics, first identify the type of bottleneck, then select the appropriate command.
When a system slows down, the worst approach is to run every monitoring command available. The correct procedure is to start with `top -b -n 1 | head -n 5` to check the overall load and the composition of `%Cpu(s)`: a high `%usr` suggests compute-intensive tasks in user space; a high `%sys` points to kernel overhead (such as context switching or interrupts); and a high `%iowait` directs attention toward the disk. Next, use `mpstat -P ALL 1 1` to check for "core imbalance"—where one core is maxed out while others remain idle—and use `pidstat -u -p <pid> 1` to pinpoint the CPU consumption of a specific process. For disk-related issues, use `iostat -xz 1` to observe `await` times and queue depth, and `pidstat -d 1` to identify which process is performing heavy read/write operations. If you need to review historical trends, `sar -u`, `sar -r`, and `sar -b` (which rely on data collected by `sysstat`) are invaluable—provided that `sysstat` was enabled on the production machine beforehand; this proactive setup is often more critical than attempting to capture data on the fly during an incident. If you find the information density of `top` insufficient, `btop` offers a graphical overview of CPU, memory, disk, and network usage. It also allows for filtering and sending signals directly from within its interface, making it well-suited for a quick system scan rather than in-depth analysis. Security Auditing: Ensuring a Verifiable Record of "Who Changed What"
In the context of regulatory compliance and security standards (such as China’s MLPS), relying solely on `/var/log/auth.log` is no longer sufficient. The `auditd` framework captures file access and system calls at the kernel level: use `auditctl -w /etc/ -p wa -k etc_changes` to monitor writes and attribute changes in the `/etc/` directory; `ausearch -k etc_changes` to retrieve logs by keyword; `aureport -f -i` to generate file audit summaries; and `aureport --login` to view login statistics. For a quick assessment of your system’s current security posture, `lynis audit system` provides a comprehensive, itemized set of recommendations—covering user accounts, permissions, service configurations, and compliance—within minutes. While it serves as an excellent starting point for quarterly health checks, it is not a substitute for an in-depth security audit. Another often-overlooked aspect is file integrity: by establishing a baseline for critical binaries or configuration files using `sha256sum`, you can transform "something feels off" into a concrete "hash mismatch" detection.
Additional Considerations for Cloud Servers: I/O and Networking
When working with cloud servers, two extra dimensions become critical. The latency distribution for NVMe disks (monitored via `iostat`) differs significantly from that of physical SATA drives, and the `%steal` metric in `mpstat`—reflecting CPU cycles "stolen" by the hypervisor—warrants close attention. On the networking side, `ss -tulpn` is a superior alternative to `netstat` for identifying listening ports and their associated processes; it is more lightweight and provides more comprehensive data on modern kernels. Once operational tasks are optimized, remaining bottlenecks often lie within the underlying I/O or network infrastructure. This is why many teams, after refining their command-line workflows, shift their focus toward cloud solutions that offer NVMe storage and premium network routes (such as CN2 GIA). In short: commands help you "see clearly," while the underlying infrastructure determines your system's "resilience."
Integrating these 14 sets of commands into your daily routine yields benefits that compound over time: saving seconds on every search, avoiding detours during troubleshooting, and gaining greater certainty during every security audit. Tools evolve, but the underlying logic remains the same: first, identify the type of bottleneck; next, select the appropriate command; and finally, ensure that the infrastructure does not become the next bottleneck.