360 Secure SkillHub
360 安全技能中心

x-uname

这是x-cmd的扩展模块,替代原生uname命令,以彩色键值对形式显示主机名、OS名、内核版本、硬件架构等系统信息,管道输出时自动禁用颜色以方便解析。支持Linux、macOS、Windows跨平台运行,适合快速查看系统详情或提取特定参数,输入为执行`x uname`命令,输出结构化系统信息。

edwinjhlee
edwinjhlee
热度 56.30
最近更新 2026-05-11 17:30:16
分类:效率依赖:代码执行应用场景:数据处理 / DevOps

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add x-uname
Metadata
name
x-uname
description
Enhanced `uname` command with colorized, structured output. Shows hostname, OS, kernel, architecture. **Dependency**: This is an x-cmd module. Install x-cmd first (see x-cmd skill for installation options). see x-cmd skill for installation.
license
Apache-2.0
compatibility
POSIX Shell
metadata
{"author":"Li Junhao","version":"1.0.0","category":"x-cmd-extension","tags":["x-cmd","system","uname","sysinfo"]}

x uname - System Information

Enhanced uname command with colorized, structured output.


Quick Start

# Display system information
x uname

Features

  • Colorized output: Key-value format with ANSI colors (auto-disabled when piped)
  • Structured display: hostname, osname, kernel, machine, version
  • Cross-platform: Works on Linux, macOS, Windows (via cosmo)

Output Fields

Field Description Example
hostname System hostname myserver
osname Operating system name Linux, Darwin
kernel Kernel version 5.15.0-91-generic
machine Hardware architecture x86_64, arm64
version Full OS version string #101-Ubuntu SMP...

Examples

Basic Usage

# Default - colorful structured output
x uname

# Output example:
# hostname   :  myserver
# osname     :  Linux
# kernel     :  5.15.0-91-generic
# machine    :  x86_64
# version    :  #101-Ubuntu SMP Tue Nov 14 13:29:11 UTC 2023

Pipe Usage

Colors are automatically disabled when output is piped:

# No colors in piped output
x uname | cat

# Parse with awk
x uname | awk -F': ' '/kernel/{print $2}'

Comparison with Native uname

Command Output Style
uname -a Single line, space-separated
x uname Multi-line, key-value format
# Native uname
$ uname -a
Linux myserver 5.15.0-91-generic #101-Ubuntu SMP ... x86_64 x86_64 x86_64 GNU/Linux

# x uname
$ x uname
hostname   :  myserver
osname     :  Linux
kernel     :  5.15.0-91-generic
machine    :  x86_64
version    :  #101-Ubuntu SMP Tue Nov 14 13:29:11 UTC 2023

Related

  • Native uname(1) manual page