Linux uname --打印系统信息
2016-04-08 11:10
393 查看
用途说明
uname命令用来打印系统信息(printsystem information),包括系统名称、内核版本等重要信息。美中不足的是无法打印Linux发行版本的名称,比如打印RHEL5.5或
CentOS5.5之类的,另外一个命令lsb_release可以打印这些。相关资料【2】中提供了一些别的方法可以取得系统版本信息。
常用参数
-a 打印全部系统信息。
-r 打印内核发行版本。
在脚本中可以使用 `uname -r`或者 $(uname -r) 取得内核发行版本,比如2.4.18。
使用示例
示例一 打印使用方法
[root@web186 root]#
uname --help
用法:uname [选项]...
Print certain systeminformation. With no OPTION, same as -s.
-a,--all print all information, in the following order:
-s,--kernel-name print the kernel name
-n,--nodename printthe 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 theprocessor type
-i,--hardware-platform print the hardware platform
-o,--operating-system print the operating system
--help
显示此帮助信息并离开
--version
显示版本信息并离开
Report bugs to<bug-coreutils@gnu.org>.
[root@web186 root]#
示例二 在RHEL5.5下的结果
[root@new55 ~]#
uname
Linux
[root@new55 ~]#
uname -a
Linux new552.6.18-194.el5 #1 SMP Tue Mar 16 21:52:43 EDT 2010 i686 i686 i386 GNU/Linux
[root@new55 ~]#
uname -s
Linux
[root@new55 ~]#
uname -m
i686
[root@new55 ~]#
uname -i
i386
[root@new55 ~]#
uname -n
new55
[root@new55 ~]#
uname -v
#1 SMP Tue Mar 1621:52:43 EDT 2010
[root@new55 ~]#
uname -r
2.6.18-194.el5
示例三 其他显示系统版本信息的方法
[root@new55 ~]#
cat /proc/version
Linux version2.6.18-194.el5 (mockbuild@x86-007.build.bos.redhat.com) (gcc version 4.1.220080704 (Red Hat 4.1.2-48)) #1 SMP Tue Mar 16 21:52:43 EDT 2010
[root@new55 ~]#
cat /etc/issue
Red Hat EnterpriseLinux Server release 5.5 (Tikanga)
Kernel \r on an \m
[root@new55 ~]#
cat /etc/redhat-release
Red Hat EnterpriseLinux Server release 5.5 (Tikanga)
[root@new55 ~]#
[root@new55 ~]#
lsb_release -a
LSBVersion: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID:RedHatEnterpriseServer
Description: Red Hat Enterprise Linux Server release 5.5 (Tikanga)
Release: 5.5
Codename: Tikanga
[root@new55 ~]#
uname命令用来打印系统信息(printsystem information),包括系统名称、内核版本等重要信息。美中不足的是无法打印Linux发行版本的名称,比如打印RHEL5.5或
CentOS5.5之类的,另外一个命令lsb_release可以打印这些。相关资料【2】中提供了一些别的方法可以取得系统版本信息。
常用参数
-a 打印全部系统信息。
-r 打印内核发行版本。
在脚本中可以使用 `uname -r`或者 $(uname -r) 取得内核发行版本,比如2.4.18。
使用示例
示例一 打印使用方法
[root@web186 root]#
uname --help
用法:uname [选项]...
Print certain systeminformation. With no OPTION, same as -s.
-a,--all print all information, in the following order:
-s,--kernel-name print the kernel name
-n,--nodename printthe 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 theprocessor type
-i,--hardware-platform print the hardware platform
-o,--operating-system print the operating system
--help
显示此帮助信息并离开
--version
显示版本信息并离开
Report bugs to<bug-coreutils@gnu.org>.
[root@web186 root]#
示例二 在RHEL5.5下的结果
[root@new55 ~]#
uname
Linux
[root@new55 ~]#
uname -a
Linux new552.6.18-194.el5 #1 SMP Tue Mar 16 21:52:43 EDT 2010 i686 i686 i386 GNU/Linux
[root@new55 ~]#
uname -s
Linux
[root@new55 ~]#
uname -m
i686
[root@new55 ~]#
uname -i
i386
[root@new55 ~]#
uname -n
new55
[root@new55 ~]#
uname -v
#1 SMP Tue Mar 1621:52:43 EDT 2010
[root@new55 ~]#
uname -r
2.6.18-194.el5
示例三 其他显示系统版本信息的方法
[root@new55 ~]#
cat /proc/version
Linux version2.6.18-194.el5 (mockbuild@x86-007.build.bos.redhat.com) (gcc version 4.1.220080704 (Red Hat 4.1.2-48)) #1 SMP Tue Mar 16 21:52:43 EDT 2010
[root@new55 ~]#
cat /etc/issue
Red Hat EnterpriseLinux Server release 5.5 (Tikanga)
Kernel \r on an \m
[root@new55 ~]#
cat /etc/redhat-release
Red Hat EnterpriseLinux Server release 5.5 (Tikanga)
[root@new55 ~]#
[root@new55 ~]#
lsb_release -a
LSBVersion: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID:RedHatEnterpriseServer
Description: Red Hat Enterprise Linux Server release 5.5 (Tikanga)
Release: 5.5
Codename: Tikanga
[root@new55 ~]#
相关文章推荐
- Linux umount --卸除文件系统
- Linux umask --档案预设权限
- Linux tzselect --选择时区
- 【Linux学习】如何了解一个陌生的命令?
- Linux tz --下载文件,无需ftp/sftp
- Linux type --显示命令的类型
- Linux touch --创建文件或修改文件时间
- Linux top --实时监视Linux任务
- linux输入子系统之按键驱动
- Linux true --空操作,设置退出码为0
- Linux tree --以树状图列出目录的内容
- Linux trap --在脚本中处理信号
- Linux time --测定一个命令的资源使用情况
- Linux test --检查文件和比较值
- Linux telnet --基于TELNET协议的远程登录工具
- Linux文件处理命令
- Linux tee --重定向输出到多个文件
- Linux tar --解压缩工具
- 1.4 linux安装mysql5.7.11
- CentOS7修改设置静态IP和DNS