linux uname指令介紹

linux版本使用:Centos7
文中的程式,皆為實際使用個人環境所測試!



uname
[test@7c0d5fd24170 /]$ uname
Linux
會印出系統的內核名稱:Linux,與uname -s相同

uname -a
[test@7c0d5fd24170 /]$ uname -a
Linux 7c0d5fd24170 4.4.0-96-generic #119-Ubuntu SMP Tue Sep 12 14:59:54 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
會印出系統的所有的資訊,會忽略未知的處理器與未知的硬件平台:
Linux 7c0d5fd24170 4.4.0-96-generic #119-Ubuntu SMP Tue Sep 12 14:59:54 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
系統:Linux
機器名稱:7c0d5fd24170(因是使用docker建置之虛擬環境)
內核版本:4.4.0-96-generic

uname -s
[test@7c0d5fd24170 /]$ uname -s
Linux
會印出系統的內核名稱。

uname -n
[test@7c0d5fd24170 /]$ uname -n
7c0d5fd24170
會印出顯示於網路上的主機名稱。

uname -r
[test@7c0d5fd24170 /]$ uname -r
4.4.0-96-generic
會印出內核的版本。

uname -v
[test@7c0d5fd24170 /]$ uname -v
#119-Ubuntu SMP Tue Sep 12 14:59:54 UTC 2017
會印出內核運行於哪個linux上(因本機是使用ubuntu,所以非centos),和實際發行的日期。

uname -m
[test@7c0d5fd24170 /]$ uname -m
x86_64
會印出電腦類型:x86_64(為64位元架構,如為32位元會如:x86_32)

uname -p
[test@7c0d5fd24170 /]$ uname -p
x86_64
會印出處理器類型:x86_64(為64位元架構,如為32位元會如:x86_32)

uname -i
[test@7c0d5fd24170 /]$ uname -i
x86_64
會印出硬件平台類型:x86_64(硬件平台包括如CPU、儲存裝置、主機板等等硬體)

uname -o
[test@7c0d5fd24170 /]$ uname -o
GNU/Linux
會印出操作系統名稱:GNU/Linux(作業系統,如windows)

uname -h
[test@7c0d5fd24170 /]$ 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

GNU coreutils online help: 
Report uname translation bugs to 
For complete documentation, run: info coreutils 'uname invocation'
會印出這個指令的幫助,與各個參數的功能

uname --version
[test@7c0d5fd24170 /]$ uname --version
uname (GNU coreutils) 8.22
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later .
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.
會印出這個指令(uname)的版本與其他訊息(包括聲明、授權等等)

留言

這個網誌中的熱門文章

PHP - 透過內建curl擷取內容

SQL ALTER TABLE簡單使用