好记性不如烂笔头^_^
Linux命令——uname
命令简介
Uname是unix name的缩写,该命令用于打印当前系统相关信息(内核版本号、硬件架构、主机名称和操作系统类型等)。
使用方法
uname [option]
选项详解
其实这些都可以通过 –help 来查,这里相当于翻译一下
root@xqf:~# uname --help
Usage: uname [OPTION]...
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 or "unknown"
-i, --hardware-platform print the hardware platform or "unknown"
-o, --operating-system print the operating system
--help display this help and exit
--version output version information and exit
option | 含义 |
---|---|
-a | (all)显示全部的信息 |
-m | (machine)显示电脑类型 |
-n | (nodename)显示在网络上的主机名称 |
-r | (release)显示操作系统的发行编号 |
-s | (sysname)显示操作系统名 |
-v | (version)显示操作系统的版本 |
-p | (processor)输出处理器类型或”unknown” |
-i | (hardware-platform)输出硬件平台或”unknown” |
-o | (operating-system)输出操作系统名称 |
–help | 显示帮助 |
–version | 显示版本信息 |
示例
root@xqf:~# uname -m
x86_64
root@xqf:~# uname -n
xqf
root@xqf:~# uname -r
4.2.0-27-generic
root@xqf:~# uname -v
#32~14.04.1-Ubuntu SMP Fri Jan 22 15:32:26 UTC 2016
root@xqf:~# uname -p
x86_64
root@xqf:~# uname -i
x86_64
root@xqf:~# uname -o
GNU/Linux
root@xqf:~# uname -a
Linux xqf 4.2.0-27-generic #32~14.04.1-Ubuntu SMP Fri Jan 22 15:32:26 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
root@xqf:~# uname
Linux
root@xqf:~# uname -s
Linux
root@xqf:~# uname --version
uname (GNU coreutils) 8.21
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://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.
Written by David MacKenzie.