網(wǎng)站建設(shè)推廣新聞成都疫情最新情況
簡介
uname命令用于顯示操作系統(tǒng)信息,例如內(nèi)核版本、主機(jī)名、處理器類型等
uname常用的有-a,-r,-rs
參數(shù)
--help 顯示幫助。-a 或--all 顯示全部信息,包括內(nèi)核名、主機(jī)名、內(nèi)核版本、處理器類型和硬件架構(gòu)等。
-s 或--sysname 顯示內(nèi)核名。
-n 或--nodename 顯示主機(jī)名(網(wǎng)絡(luò)節(jié)點(diǎn)上)。
-r 或--kernel-release 顯示內(nèi)核發(fā)行版。
-v 或--kernel-version 顯示內(nèi)核版本。
-m 或--machine 顯示計(jì)算機(jī)硬件架構(gòu)。
-p 或--processor 顯示主機(jī)處理器類型
-i 或--hardware-platform 顯示硬件平臺
-o 或--operating-system 顯示操作系統(tǒng)名稱
[root@ali5messrv1 ~]# 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
示例
[root@ali5messrv1 ~]# uname -a?
Linux ali5messrv1 5.17.6-1.el7.elrepo.x86_64 #1 SMP Wed Nov 11 09:49:09 EST 2020 x86_64 x86_64 x86_64 GNU/Linux?# 以下都是和上面一一對應(yīng)
[root@ali5messrv1 ~]# uname -s
Linux
[root@ali5messrv1 ~]# uname -n
ali5messrv1
[root@ali5messrv1 ~]# uname -r
5.9.8-1.el7.elrepo.x86_64
[root@ali5messrv1 ~]# uname -v
#1 SMP Wed Nov 11 09:49:09 EST 2020
[root@ali5messrv1 ~]# uname -m
x86_64
[root@ali5messrv1 ~]# uname -p
x86_64
[root@ali5messrv1 ~]# uname -i
x86_64
[root@ali5messrv1 ~]# uname -o
GNU/Linux
Linux |ali5messrv1 | 5.17.6-1.el7.elrepo.x86_64 | #1 SMP Wed Nov 11 09:49:09 EST 2020 | x86_64 | x86_64 | x86_64 | GNU/Linux?
內(nèi)核名 | 主機(jī)名 | 內(nèi)核發(fā)行版 | 內(nèi)核版本 | 機(jī)器硬件架構(gòu) | 處理器類型 | 硬件平臺 | 操作系統(tǒng)名
?經(jīng)常會需要查看內(nèi)核發(fā)行版,直接用 uname -rs 即可
[root@ali5messrv1 ~]# uname -rs
Linux 5.9.8-1.el7.elrepo.x86_64
?
el7:表示正在使用的內(nèi)核是 RedHat / CentOS 系列發(fā)行版專用內(nèi)核 ,centos7?
centos8的是el8
內(nèi)核解讀參考此文:
centos7升級內(nèi)核 詳解 linux-CSDN博客
====================分割線========================?
文章到此已經(jīng)結(jié)束,以下是紫薯布丁
--help 顯示幫助。
-a 或--all ? ? ? ? ? ? ? ? 顯示全部信息,包括內(nèi)核名、主機(jī)名、內(nèi)核版本、處理器類型和硬件架構(gòu)等。
-s 或--sysname ? ? ? ? ? ? 顯示內(nèi)核名。
-n 或--nodename ? ? ? ? ? ?顯示主機(jī)名(網(wǎng)絡(luò)節(jié)點(diǎn)上)。
-r 或--kernel-release ? ? ?顯示內(nèi)核發(fā)行版。
-v 或--kernel-version ? ? ?顯示內(nèi)核版本。
-m 或--machine ? ? ? ? ? ? 顯示計(jì)算機(jī)硬件架構(gòu)。
-p 或--processor ? ? ? ? ? 顯示主機(jī)處理器類型
-i 或--hardware-platform ? 顯示硬件平臺
-o 或--operating-system ? ?顯示操作系統(tǒng)名稱
[root@ali5messrv1 ~]# 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
[root@ali5messrv1 ~]# uname -a?
Linux ali5messrv1 5.17.6-1.el7.elrepo.x86_64 #1 SMP Wed Nov 11 09:49:09 EST 2020 x86_64 x86_64 x86_64 GNU/Linux?
# 以下都是和上面一一對應(yīng)
[root@ali5messrv1 ~]# uname -s
Linux
[root@ali5messrv1 ~]# uname -n
ali5messrv1
[root@ali5messrv1 ~]# uname -r
5.9.8-1.el7.elrepo.x86_64
[root@ali5messrv1 ~]# uname -v
#1 SMP Wed Nov 11 09:49:09 EST 2020
[root@ali5messrv1 ~]# uname -m
x86_64
[root@ali5messrv1 ~]# uname -p
x86_64
[root@ali5messrv1 ~]# uname -i
x86_64
[root@ali5messrv1 ~]# uname -o
GNU/Linux
Linux ?|ali5messrv1 | 5.17.6-1.el7.elrepo.x86_64 | #1 SMP Wed Nov 11 09:49:09 EST 2020 | ? ?x86_64 ? ?| ? x86_64 ? | x86_64 ? | GNU/Linux?
內(nèi)核名 | ?主機(jī)名 ? ? | ? ? ? ? 內(nèi)核發(fā)行版 ? ? ? ? ?| ? ? ? ? ? ? ? 內(nèi)核版本 ? ? ? ? ? ? ? | 機(jī)器硬件架構(gòu) ?| 處理器類型 ?| 硬件平臺 | 操作系統(tǒng)名
[root@ali5messrv1 ~]# uname -rs
Linux 5.9.8-1.el7.elrepo.x86_64