关于 system-admin
面向 Linux 系统管理的技能,汇集系统信息查询、资源监控和服务管理命令,并提供常见故障排查方法。
主要功能
- 01查看系统与硬件信息
- 02实时及历史资源监控
- 03管理 systemd 服务
- 04排查负载、磁盘与内存问题
适用场景
- 01检查系统健康状况
- 02定位高 CPU 或内存进程
- 03诊断磁盘空间不足
- 04检查异常服务及日志
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ chaterm/ terminal-skills --skill system-admin安装后在 Claude Code 中输入/system-admin确认已加载。
详细介绍
Linux 系统管理
概述
Linux 系统管理的核心命令和最佳实践,包括查看系统信息、监控资源、管理服务等。
系统信息
基本信息
# System version
cat /etc/os-release
uname -a
# Hostname
hostnamectl
# Uptime and load
uptime
硬件信息
# CPU information
lscpu
cat /proc/cpuinfo
# Memory information
free -h
cat /proc/meminfo
# Disk information
lsblk
df -h
资源监控
实时监控
# Comprehensive monitoring
top
htop
# Memory monitoring
vmstat 1
# IO monitoring
iostat -x 1
iotop
# Network monitoring
iftop
nethogs
历史数据
# System activity report
sar -u 1 10 # CPU
sar -r 1 10 # Memory
sar -d 1 10 # Disk
服务管理
Systemd 服务
# Service status
systemctl status service-name
systemctl is-active service-name
# Start/Stop services
systemctl start/stop/restart service-name
# Boot startup
systemctl enable/disable service-name
# View all services
systemctl list-units --type=service
常见场景
场景 1:系统健康检查
# Quick health check script
echo "=== System Load ===" && uptime
echo "=== Memory Usage ===" && free -h
echo "=== Disk Usage ===" && df -h
echo "=== Failed Services ===" && systemctl --failed
场景 2:排查高负载
# 1. Check load
uptime
# 2. Find high CPU processes
ps aux --sort=-%cpu | head -10
# 3. Find high memory processes
ps aux --sort=-%mem | head -10
故障排查
| 问题 | 命令 |
|---|---|
| 系统卡顿 | top、vmstat 1、iostat -x 1 |
| 磁盘空间不足 | df -h、du -sh /*、ncdu |
| 内存不足 | free -h、ps aux --sort=-%mem |
| 服务异常 | systemctl status、journalctl -u |
评论
支持 Markdown