System Admin

chaterm/terminal-skills/linux/system-admin

作者 chaterm464c2954287ad0c0b9addb1ebfbb2150ddc0de24无许可证58 个星标收录于 2026年10月9日更新于 2026年10月9日仓库7个月前更新

Linux system administration and monitoring

仅含说明DevOps & Cloud
AI 生成的概览

提供 Linux 系统管理命令参考,用于查看系统信息、监控资源和管理服务。

功能
该技能提供 Linux 系统管理命令与实践的参考集合。内容涵盖系统与硬件信息查看、实时与历史资源监控、systemd 服务管理,以及高负载、磁盘占满等故障排查场景。它产出的是命令参考和建议的命令序列,而不是脚本或文件。
适用场景
适用于需要检查 Linux 系统健康状况、查看 CPU、内存、磁盘或网络使用情况、管理 systemd 服务,或诊断高负载、磁盘耗尽、服务异常等常见问题的场景。
运行要求
需要 Linux 系统以及常见管理工具,如 systemctl、journalctl、top、vmstat、iostat、sar 等相关实用程序。该技能不附带脚本,仅为说明性指令。

Linux System Administration

Overview

Core commands and best practices for Linux system administration, including system information viewing, resource monitoring, service management, etc.

System Information

Basic Information

bash
# System versioncat /etc/os-releaseuname -a
# Hostnamehostnamectl
# Uptime and loaduptime

Hardware Information

bash
# CPU informationlscpucat /proc/cpuinfo
# Memory informationfree -hcat /proc/meminfo
# Disk informationlsblkdf -h

Resource Monitoring

Real-time Monitoring

bash
# Comprehensive monitoringtophtop
# Memory monitoringvmstat 1
# IO monitoringiostat -x 1iotop
# Network monitoringiftopnethogs

Historical Data

bash
# System activity reportsar -u 1 10    # CPUsar -r 1 10    # Memorysar -d 1 10    # Disk

Service Management

Systemd Services

bash
# Service statussystemctl status service-namesystemctl is-active service-name
# Start/Stop servicessystemctl start/stop/restart service-name
# Boot startupsystemctl enable/disable service-name
# View all servicessystemctl list-units --type=service

Common Scenarios

Scenario 1: System Health Check

bash
# Quick health check scriptecho "=== System Load ===" && uptimeecho "=== Memory Usage ===" && free -hecho "=== Disk Usage ===" && df -hecho "=== Failed Services ===" && systemctl --failed

Scenario 2: Troubleshoot High Load

bash
# 1. Check loaduptime
# 2. Find high CPU processesps aux --sort=-%cpu | head -10
# 3. Find high memory processesps aux --sort=-%mem | head -10

Troubleshooting

ProblemCommands
System lagtop, vmstat 1, iostat -x 1
Disk fulldf -h, du -sh /*, ncdu
Memory shortagefree -h, ps aux --sort=-%mem
Service abnormalsystemctl status, journalctl -u

来源与署名

来源:chaterm/terminal-skills位于linux/system-admin提交464c295

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架