'\" te .\" Copyright 1989 AT&T .\" Copyright (c) 2003, 2012, Oracle and/or its affiliates.All rights reserved. .\" Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation.Original documentation from The Open Group can be obtained online at http://www.opengroup.org/bookstore/. .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation.In the following statement, the phrase "this text" refers to portions of the system documentation.Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group.In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document.The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.This notice shall appear on any product containing this material. .TH uname 1 "2012 年 5 月 8 日" "SunOS 5.11" "用户命令" .SH 名称 uname \- 输出当前系统的名称 .SH 用法概要 .LP .nf \fBuname\fR [\fB-aimnprsvX\fR] .fi .LP .nf \fBuname\fR [\fB-S\fR \fIsystem_name\fR] .fi .SH 描述 .sp .LP \fBuname\fR 实用程序可在标准输出中输出关于当前系统的信息。如果指定了选项,会将表示一种或多种系统特征的符号写入标准输出。如果未指定选项,\fBuname\fR 将输出当前操作系统的名称。指定选项可以输出 \fBuname\fR(2)、\fBsysinfo\fR(2) 或两者返回的选定信息。 .SH 选项 .sp .LP 支持以下选项: .sp .ne 2 .mk .na \fB\fB-a\fR\fR .ad .sp .6 .RS 4n 列显当前可从系统中获得的基本信息。 .RE .sp .ne 2 .mk .na \fB\fB-i\fR\fR .ad .sp .6 .RS 4n 列显平台的名称。对于采用 \fBsun4v\fR 体系结构的计算机,\fB-i\fR 选项将返回:\fBsun4v\fR。将 \fBprtconf\fR(1M) 与 \fB-b\fR 选项一起使用可获得 \fBsun4v\fR 计算机的平台名称。 .RE .sp .ne 2 .mk .na \fB\fB-m\fR\fR .ad .sp .6 .RS 4n 列显计算机硬件名称(类)。不建议使用该选项。应改用 \fBuname\fR \fB-p\fR。请参见下面的“附注”部分。 .RE .sp .ne 2 .mk .na \fB\fB-n\fR\fR .ad .sp .6 .RS 4n 列显节点名称(节点名称是通信网络用于识别系统的名称)。 .RE .sp .ne 2 .mk .na \fB\fB-p\fR\fR .ad .sp .6 .RS 4n 列显当前主机的 \fBISA\fR 或处理器类型。 .RE .sp .ne 2 .mk .na \fB\fB-r\fR\fR .ad .sp .6 .RS 4n 列显操作系统发行版级别。 .RE .sp .ne 2 .mk .na \fB\fB-s\fR\fR .ad .sp .6 .RS 4n 列显操作系统的名称。这是缺省值。 .RE .sp .ne 2 .mk .na \fB\fB-S\fR \fIsystem_name\fR\fR .ad .sp .6 .RS 4n 节点名称可以通过指定系统名称参数进行更改。系统名称参数仅限使用 \fBSYS_NMLN\fR 字符。\fBSYS_NMLN\fR 是在 \fB\fR 中定义的实现特定值。只允许超级用户使用该功能。这项更改在系统重新引导后不会保留。 .RE .sp .ne 2 .mk .na \fB\fB-v\fR\fR .ad .sp .6 .RS 4n 列显操作系统版本。 .RE .sp .ne 2 .mk .na \fB\fB-X\fR\fR .ad .sp .6 .RS 4n 列显扩展系统信息,按照 SCO UNIX 的要求,每行列显一个信息元素。显示的信息包括: .RS +4 .TP .ie t \(bu .el o 系统名称、节点、发行版、版本、计算机和 CPU 数目。 .RE .RS +4 .TP .ie t \(bu .el o 总线类型、串行设备和用户(在 Solaris 中设置为 \fBunknown\fR)。 .RE .RS +4 .TP .ie t \(bu .el o OEM 编号和原产地编号(分别设置为 \fB0\fR 和 \fB1\fR) .RE .RE .SH 示例 .LP \fB示例 1 \fR列显 OS 名称和发行版级别 .sp .LP 以下命令将输出操作系统名称和发行版级别,由一个 SPACE 字符分隔: .sp .in +2 .nf example% \fBuname \(misr\fR .fi .in -2 .sp .SH 环境变量 .sp .LP 有关影响 \fBuname\fR 执行的以下环境变量的说明,请参见 \fBenviron\fR(5):\fBLANG\fR、\fBLC_ALL\fR、\fBLC_CTYPE\fR、\fBLC_MESSAGES\fR 和 \fBNLSPATH\fR。 .SH 退出状态 .sp .LP 将返回以下退出值: .sp .ne 2 .mk .na \fB\fB0\fR\fR .ad .sp .6 .RS 4n 成功完成。 .RE .sp .ne 2 .mk .na \fB\fB>0\fR\fR .ad .sp .6 .RS 4n 出现错误。 .RE .SH 属性 .sp .LP 有关下列属性的说明,请参见 \fBattributes\fR(5): .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . 属性类型属性值 _ 可用性system/core-os _ 接口稳定性Committed(已确定) _ 标准请参见 \fBstandards\fR(5)。 .TE .SH 另请参见 .sp .LP \fBarch\fR(1)、\fBisalist\fR(1)、\fBprtconf\fR(1M)、\fBsysinfo\fR(2)、\fBuname\fR(2)、\fBnodename\fR(4)、\fBattributes\fR(5)、\fBenviron\fR(5)、\fBstandards\fR(5) .SH 附注 .sp .LP 独立软件供应商 (Independent Software Vendor, \fBISV\fR) 和需要确定安装或执行软件的平台的详细特征的其他人应该使用 \fBuname\fR 命令。 .sp .LP 要确定操作系统名称和发行版级别,应使用 \fBuname\fR \fB-sr\fR。要仅确定操作系统发行版级别,应使用 \fBuname\fR \fB-r\fR。请注意,操作系统发行版级别并不一定采用 \fIx.y\fR 格式(例如 5.3、5.4、5.5 等等),未来的发行版可能会采用 \fIx.y.z\fR 格式(例如 5.3.1、5.3.2、5.4.1 等等)。 .sp .LP 在 SunOS 4.\fIx\fR 发行版中,\fBarch\fR(1) 命令常用来获取类似于使用 \fBuname\fR 命令获取的信息。\fBarch\fR(1) 命令输出 \fBsun4\fR 常常错误地解释为表示 SunOS SPARC 系统。如果需要硬件平台信息,应使用 \fBuname\fR \fB-sp\fR。 .sp .LP \fBarch\fR \fB-k\fR 和 \fBuname\fR \fB-m\fR 命令返回等效值;但是,不建议第三方程序使用这两个命令,就像一般不建议使用 \fBarch\fR 命令一样。要确定计算机的指令集体系结构 (Instruction Set Architecture, \fBISA\fR) 或处理器类型,应使用带有 \fB-p\fR 选项的 \fBuname\fR。