uname 命令可用於大多數 UNIX 和類 UNIX 系統以及 Linux。 html
功能說明:uname用來獲取電腦和操做系統的相關信息。
語 法:uname [-amnrsvpio][--help][--version]
補充說明:uname可顯示linux主機所用的操做系統的版本、硬件的名稱等基本信息。
參 數:
-a或–all 詳細輸出全部信息,依次爲內核名稱,主機名,內核版本號,內核版本,硬件名,處理器類型,硬件平臺類型,操做系統名稱
-m或–machine 顯示主機的硬件(CPU)名
-n或-nodename 顯示主機在網絡節點上的名稱或主機名稱
-r或–release 顯示linux操做系統內核版本號
-s或–sysname 顯示linux內核名稱
-v 顯示顯示操做系統是第幾個 version 版本
-p 顯示處理器類型或unknown
-i 顯示硬件平臺類型或unknown
-o 顯示操做系統名
–help 得到幫助信息
–version 顯示uname版本信息
最經常使用參數 uname -a node
幾個使用示例(資料來自linuxso.com):
[root@linuxso.com ~]# uname
Linux
注:單獨使用uname命令時至關於uname -s
[root@linuxso.com ~]# uname -a
Linux linuxso.com 2.6.18-4-686 #1 SMP Mon Mar 26 17:17:36 UTC 2007 i686 GNU/Linux
[root@linuxso.com ~]# uname -m
i686
[root@linuxso.com ~]# uname -n
linuxso.com
[root@linuxso.com ~]# uname -r
2.6.18-4-686
[root@linuxso.com ~]# uname -s
Linux
[root@linuxso.com ~]# uname -v
#1 SMP Mon Mar 26 17:17:36 UTC 2007
[root@linuxso.com ~]# uname -p
i686
[root@linuxso.com ~]# uname -i
i386
[root@linuxso.com ~]# uname -o
GNU/Linux
[root@linuxso.com ~]# uname --version //兩個-
uname (GNU coreutils) 5.97
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software. You may redistribute copies of it under the terms of
the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
There is NO WARRANTY, to the extent permitted by law.
Written by David MacKenzie. linux