OS info

OSのバージョンやカーネルなどのバージョン・システム情報を調べる方法

 
※この方法はいくつかの方法がありますので、その一例を紹介します。
 
1) CentOSの場合
環境: CentOS 5.5 x86_64
 
# cat /proc/version
Linux version 2.6.18-194.26.1.el5 ([email protected]) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)) #1 SMP Tue Nov 9 12:54:20 EST 2010

# cat /proc/version
Linux version 2.6.18-194.26.1.el5 ([email protected]) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)) #1 SMP Tue Nov 9 12:54:20 EST 2010

# cat /etc/redhat-release
CentOS release 5.5 (Final)

# cat /etc/issue
CentOS release 5.5 (Final)
Kernel \r on an \m

# yum list installed | grep "centos-release*"
centos-release.x86_64                   10:5-5.el5.centos              installed
centos-release-notes.x86_64             5.5-0                          installed

# rpm -qa | grep "centos-release*"
centos-release-5-5.el5.centos
centos-release-notes-5.5-0

# uname --kernel-release
2.6.18-194.26.1.el5
[root@yuu210 ~]#

# 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     この使い方を表示して終了
      --version  バージョン情報を表示して終了

# uname --all
Linux yuu210.yuuyake.biz 2.6.18-194.26.1.el5 #1 SMP Tue Nov 9 12:54:20 EST 2010 x86_64 x86_64 x86_64 GNU/Linux

 
# uname --operating-system
GNU/Linux
 
# uname --operating-system --hardware-platform
x86_64 GNU/Linux
 
# uname --kernel-name --kernel-release --kernel-version
Linux 2.6.18-194.26.1.el5 #1 SMP Tue Nov 9 12:54:20 EST 2010
 
# uname --kernel-name
Linux
 
# uname -r
2.6.18-194.26.1.el5
 
 
2) Debianの場合
環境: