linux-ops-cheatsheetlisted
Install: claude install-skill Zandereins/schliff
# Linux Ops Cheatsheet / Linux 运维速查
System-administration one-liners for Linux hosts. Read-only diagnostics are
safe to run as-is. Commands that touch the kernel, the bootloader, or running
processes carry explicit DANGER markers and confirmation gates — read them
before you paste.
## When to use / 何时使用
- Inspect memory usage (`free`) or disk IO (`iostat`).
- Cap the kernel's usable RAM for low-memory testing (`mem=` boot param).
- Detach a foreground job to the background so it survives logout (`bg` + `disown`).
- Force an unresponsive host to reboot via the SysRq interface — **last resort only**.
Do NOT use this skill for algorithm or data-structure design questions; the file
name in the upstream corpus was mislabeled "algorithms" but the content is Linux ops.
## Global preconditions / 全局前提
- Distro examples target **Red Hat / Fedora family**. Paths differ on Debian/Ubuntu/SUSE.
- Bootloader and SysRq actions require **root** (`sudo` or a root shell).
- `iostat` ships in the `sysstat` package (`sudo yum install sysstat` / `sudo dnf install sysstat`).
---
## 1. Memory usage (read-only / 只读) — 查看内存使用情���
No guard needed; this only reads counters.
```bash
free -m # show memory usage in MB / 以 MB 为单位查看内存使用情况
```
Verify: output prints `Mem:` and `Swap:` rows. Add `-h` for human-readable units.
---
## 2. Disk IO statistics (read-only / 只读) — 查看系统的 IO 统计信息
No guard needed; this only samples kernel IO counters.
```bash
iostat -k 3 # print in KB, refresh