Files
claw/scripts/sysinfo@tx-ubuntu-ubuntu.sh

25 lines
679 B
Bash

#!/usr/bin/env bash
# ============================================================
# sysinfo@tx-ubuntu-ubuntu.sh
# 主机健康速览:系统信息、磁盘、内存
#
# 用法: claw run tx-ubuntu-ubuntu sysinfo@tx-ubuntu-ubuntu.sh
# 适用: Ubuntu 24.04
# ============================================================
set -e
echo "===== 主机信息 ====="
echo "主机名: $(hostname)"
echo "系统: $(cat /etc/os-release | grep PRETTY_NAME | cut -d= -f2 | tr -d '"')"
echo "内核: $(uname -r)"
echo "运行时间: $(uptime -p)"
echo ""
echo "===== 磁盘 ====="
# 仅显示根分区,如需全部分区改成 df -h
df -h /
echo ""
echo "===== 内存 ====="
free -h