← 返回命令列表

Linux command

uname 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Show all system information

uname -a

Show kernel name

uname -s

Show hostname

uname -n

Show kernel release version

uname -r

Show kernel version

uname -v

Show machine hardware name

uname -m

Show operating system

uname -o

说明

uname prints system information about the machine and operating system. It's commonly used in scripts to detect the platform and adjust behavior accordingly. The most common uses are uname -a for all information and uname -m to determine the system architecture (useful for downloading correct binaries). Different Unix systems may support different options. The -s, -n, -r, -v, and -m options are most portable across Unix variants.

参数

-a, --all
Print all information
-s, --kernel-name
Print kernel name (e.g., Linux)
-n, --nodename
Print network hostname
-r, --kernel-release
Print kernel release (e.g., 5.15.0-generic)
-v, --kernel-version
Print kernel version
-m, --machine
Print machine hardware name (e.g., x86_64, arm64)
-p, --processor
Print processor type
-i, --hardware-platform
Print hardware platform
-o, --operating-system
Print operating system

FAQ

What is the uname command used for?

uname prints system information about the machine and operating system. It's commonly used in scripts to detect the platform and adjust behavior accordingly. The most common uses are uname -a for all information and uname -m to determine the system architecture (useful for downloading correct binaries). Different Unix systems may support different options. The -s, -n, -r, -v, and -m options are most portable across Unix variants.

How do I run a basic uname example?

Run `uname -a` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -a, --all do in uname?

Print all information