← 返回
开发者工具 中文

x-uptime

Enhanced `uptime` with structured YAML output showing uptime, users, and 1/5/15-minute load averages. **Dependency**: This is an x-cmd module. Install x-cmd...
增强版 `uptime`,以结构化 YAML 格式输出运行时间、用户数及 1/5/15 分钟平均负载。**依赖**:这是一个 x-cmd 模块。请安装 x-cmd...
edwinjhlee
开发者工具 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 1
Stars
📥 506
下载
💾 6
安装
1
版本
#latest

概述

x uptime - System Uptime and Load

> Enhanced uptime command with structured YAML output and cross-platform support.


Quick Start

# YAML format output (default)
x uptime

# Raw uptime command output
x uptime --raw

Features

  • Structured YAML output: Easy to parse and read
  • Load averages: 1, 5, and 15-minute trends
  • Cross-platform: Linux, macOS, Windows (via cosmo/busybox)
  • Auto-detection: Uses native, busybox, or cosmo backends

Output Fields

FieldDescriptionExample
-----------------------------
timeCurrent system time14:32:10
upSystem uptime5 days, 3 hours, 27 minutes
usersLogged-in users count2 users
loadLoad averages (1m, 5m, 15m)0.52, 0.58, 0.59

Commands

CommandDescription
----------------------
x uptimeYAML format output (default)
x uptime --ymlYAML format (explicit)
x uptime --rawRaw system uptime output

Examples

Basic Usage

# Default YAML output
x uptime

# Output example:
# time  : 14:32:10
# up    : 5 days, 3 hours, 27 minutes
# users : 2 users
# load  : 0.52, 0.58, 0.59

Raw Output

# Traditional uptime output
x uptime --raw
# 14:32:10 up 5 days, 3:27, 2 users, load average: 0.52, 0.58, 0.59

Parsing

# Extract uptime
x uptime | awk -F': ' '/^up/{print $2}'

# Get load average
x uptime | awk -F': ' '/^load/{print $2}'

Understanding Load Averages

Load averages indicate system busyness - the average number of processes waiting for CPU or I/O.

ValueInterpretation
-----------------------
< 1.0System has spare capacity
≈ 1.0System is fully utilized
> 1.0Processes are waiting (queue forming)

The three numbers show:

  • 1 min: Short-term trend (immediate load)
  • 5 min: Medium-term trend (recent history)
  • 15 min: Long-term trend (sustained load)

Multi-Core Systems

Divide load by CPU core count:

# 4-core system with load 3.2
effective_load = 3.2 / 4 = 0.8  # Still has capacity

Platform Notes

Linux

  • Uses native uptime command
  • Full feature support

macOS

  • Uses native uptime command
  • Full feature support

Windows

  • No native uptime command
  • Automatically uses cosmo binary or busybox

Related

  • Native uptime(1) manual page

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-30 02:30 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 66 📥 179,996
security-compliance

x-osv

edwinjhlee
Google OSV 数据库的命令行工具。查询软件包漏洞,扫描本地项目的依赖漏洞。**依赖**:这是 x-cmd 模块。
★ 1 📥 593
developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 668 📥 323,973