国际访客建议访问 Primers 编程伙伴 国际版站点 > Bash 教程 > uname 以获得更好的体验。

# Bash 的 uname 命令

uname [OPTION]...

!subtitle:功能

查看系统信息。

!subtitle:类型

可执行文件(/usr/bin/uname),属于 coreutils

!subtitle:参数

  • OPTION 选项:

    • -a, --all - 打印所有信息

    • -s, --kernel-name - 打印内核名称

    • -n, --nodename - 打印网络节点主机名

    • -r, --kernel-release - 打印内核发布版本

    • -v, --kernel-version - 打印内核版本

    • -m, --machine - 打印机器硬件名称

    • -p, --processor - 打印处理器类型

    • -i, --hardware-platform - 打印硬件架构

    • -o, --operating-system - 打印操作系统

    • --help - 显示帮助

    • --version - 显示版本

# 示例

$uname -a
Linux dev 6.8.0-87-generic #88-Ubuntu SMP PREEMPT_DYNAMIC Sat Oct 11 09:28:41 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
$uname -s
Linux
$uname -n
dev
$uname -r
6.8.0-87-generic
$uname -v
#88-Ubuntu SMP PREEMPT_DYNAMIC Sat Oct 11 09:28:41 UTC 2025
$uname -m
x86_64
$uname -p
x86_64
$uname -i
x86_64
$uname -o
GNU/Linux

# 推荐阅读

# 手册

UNAME(1)                         User Commands                        UNAME(1)

NAME
       uname - print system information

SYNOPSIS
       uname [OPTION]...

DESCRIPTION
       Print certain system information.  With no OPTION, same as -s.

       -a, --all
              print  all  information,  in the following order, except omit -p
              and -i if unknown:

       -s, --kernel-name
              print the kernel name

       -n, --nodename
              print the network node hostname

       -r, --kernel-release
              print the kernel release

       -v, --kernel-version
              print the kernel version

       -m, --machine
              print the machine hardware name

       -p, --processor
              print the processor type (non-portable)

       -i, --hardware-platform
              print the hardware platform (non-portable)

       -o, --operating-system
              print the operating system

       --help display this help and exit

       --version
              output version information and exit

AUTHOR
       Written by David MacKenzie.

REPORTING BUGS
       GNU coreutils online help: <https://www.gnu.org/software/coreutils/>
       Report any translation bugs to <https://translationproject.org/team/>

COPYRIGHT
       Copyright © 2023 Free Software Foundation, Inc.   License  GPLv3+:  GNU
       GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
       This  is  free  software:  you  are free to change and redistribute it.
       There is NO WARRANTY, to the extent permitted by law.

SEE ALSO
       arch(1), uname(2)

       Full documentation <https://www.gnu.org/software/coreutils/uname>
       or available locally via: info '(coreutils) uname invocation'

GNU coreutils 9.4                 April 2024                          UNAME(1)
本文 更新于: 2026-03-06 09:52:36 创建于: 2026-03-06 09:52:36