Unix Manual Pages

A History of Unix

Unix in Summary

An introductory tutorial on Unix...


Selecting a Shell

Regular Expressions...

Perl and Unix...

Help with vi...

Shell scripting...


The 10 Unix commands every beginner needs to know...

The 10 most misunderstood commands...

The 62 Core Commands

Commands by Category

Alphabetic list of commands...


Copyright/Copyleft info...

pwd





Print Working Directory

Examples

Display current directory:
pwd
returns /usr/bin/local

OS FreeBSD SunOS
NAME pwd - return working directory name pwd - return working directory name
SYNOPSIS pwd /usr/bin/pwd
DESCRIPTION Pwd writes the absolute pathname of the current working directory to the standard output. The pwd utility exits 0 on success, and >0 if an error occurs. pwd writes an absolute path name of the current working directory to standard output. Both the Bourne shell, sh(1), and the Korn shell, ksh(1), also have a built-in pwd command.
STANDARDS The pwd command is expected to be IEEE Std1003.2 (``POSIX.2'') compatible.
ENVIRONMENT See environ(5) for descriptions of the following environment variables that affect the execution of pwd: LC_MESSAGES and NLSPATH.
EXIT STATUS The following exit values are returned:
0 Successful completion.
>0 An error occurred.
If an error is detected, output will not be written to standard output, a diagnostic message will be written to standard error, and the exit status will not be 0.
SEE ALSO cd(1), csh(1), getcwd(3) cd(1), ksh(1), sh(1), shell_builtins(1), attributes(5), environ(5)
DIAGNOSTICS "Cannot open ..." and "Read error in ..." indicate possible file system trouble and should be referred to a UNIX system administrator.
NOTES If you move the current directory or one above it, pwd may not give the correct response. Use the cd(1) command with a full path name to correct this situation.
BUGS In csh(1) the command dirs is always faster (although it can give a different answer in the rare case that the current directory or a containing directory was moved after the shell descended into it).
DISTRIBUTION 4th Berkeley Distribution April 28, 1995 SunOS 5.6 Last change: 28 Mar 1995
© 1999-2004 Matchstick Consulting