'\" te .\" Portions Copyright (c) 2007, 2014, Oracle and/or its affiliates.All rights reserved. .\" Copyright 1989 AT&T .\" Portions Copyright (c) 1982-2007 AT&T Knowledge Ventures .\" 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 pwd 1 "2014 年 2 月 14 日" "SunOS 5.11" "用户命令" .SH 名称 pwd \- 返回工作目录名称 .SH 用法概要 .LP .nf \fB/usr/bin/pwd\fR [\fB-LP\fR ] [\fB--logical\fR] [\fB--physical\fR] [\fB--help\fR] .fi .SH 描述 .sp .LP \fBpwd\fR 实用程序会向标准输出写入当前工作目录的绝对路径名。 .sp .LP 无论是 Bourne shell \fBsh\fR(1),还是 Korn shell \fBksh\fR(1) 和 \fBksh88\fR(1),它们都有内置的 \fBpwd\fR 命令。 .SH 选项 .sp .LP 支持以下选项: .sp .ne 2 .mk .na \fB\fB-P\fR, \fB--physical\fR\fR .ad .sp .6 .RS 4n 显示工作目录的物理名称。如果未指定,则为缺省选项。 .RE .sp .ne 2 .mk .na \fB\fB-L\fR, \fB--logical\fR\fR .ad .sp .6 .RS 4n 如果可能,使用 \fBPWD\fR 环境变量作为工作目录的名称(即使它只是一个符号链接)。如果是符号链接,则 \fBPWD\fR 不能包含“点”或“点-点”部分,必须指向当前工作目录。如果不满足以上条件,将采用 \fB-P\fR 行为。 .RE .sp .ne 2 .mk .na \fB\fB--help\fR\fR .ad .sp .6 .RS 4n 显示命令用法并退出。 .RE .sp .LP 如果同时指定了 \fB-L\fR 和 \fB-P\fR,则只应用最后输入的选项。 .SH 环境变量 .sp .LP 有关影响 \fBpwd\fR 执行的 \fBLANG\fR、\fBLC_ALL\fR、\fBLC_MESSAGES\fR 和 \fBNLSPATH\fR 环境变量的说明,请参见 \fBenviron\fR(5)。 .SH 退出状态 .sp .LP 将返回以下退出值: .sp .ne 2 .mk .na \fB\fB0\fR\fR .ad .RS 6n .rt 成功完成。 .RE .sp .ne 2 .mk .na \fB\fB>0\fR\fR .ad .RS 6n .rt 出现错误。 .RE .sp .LP 如果检测到错误,系统不会向标准输出写入输出,而是向标准错误写入一条诊断消息,且退出状态不会为 \fB0\fR。 .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 _ CSIEnabled(已启用) _ 接口稳定性Committed(已确定) _ 标准请参见 \fBstandards\fR(5)。 .TE .SH 另请参见 .sp .LP \fBcd\fR(1)、\fBksh\fR(1)、\fBksh88\fR(1)、\fBsh\fR(1)、\fBshell_builtins\fR(1)、\fBattributes\fR(5)、\fBenviron\fR(5)、\fBstandards\fR(5) .SH 诊断 .sp .in +2 .nf pwd: cannot determine current directory! .fi .in -2 .sp .sp .LP 请咨询网络管理员。 .SH 附注 .sp .LP 如果移动了当前目录或其上一层目录,\fBpwd\fR 可能无法提供正确的响应。此时,请在使用 \fBcd\fR(1) 命令时提供全路径名来纠正这一情况。