unixdev.net


Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (SunOS-4.1.3)
Page:
Section:
Apropos / Subsearch:
optional field

PWD(1)                      General Commands Manual                     PWD(1)



NAME
       pwd - display the pathname of the current working directory

SYNOPSIS
       pwd

DESCRIPTION
       pwd prints the pathname of the working (current) directory.

       If you are using csh(1), you can use the dirs builtin command to do the
       same job more quickly; but dirs 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.  This is because pwd  searches  back
       up  the directory tree to report the true pathname, whereas dirs remem-
       bers the pathname from the  last  cd(1)  command.   The  example  below
       illustrates the differences.

              example% cd  /usr/wendy/january/reports
              example% pwd
              /usr/wendy/january/reports
              example% dirs
              ~/january/reports
              example% mv ~/january ~/february
              example% pwd
              /usr/wendy/february/reports
              example% dirs
              ~/january/reports
              example%

       pwd  and  dirs  also  give  different answers when you change directory
       through a symbolic link.  For example:
              example% cd  /usr/wendy/january/reports
              example% pwd
              /usr/wendy/january/reports
              example% dirs
              ~/january/reports
              example% ls -l /usr/wendy/january
              lrwxrwxrwx  1 wendy          17 Jan 30  1983 /usr/wendy/january ->> /usr/wendy/1984/jan/
              example% cd  /usr/wendy/january
              example% pwd
              /usr/wendy/1984/jan
              example% dirs
              /usr/wendy/january

       The pathnames of files mounted with the Automounter can also change  if
       the  file  is not used for a certain time interval (the default is five
       minutes).  To prevent this, set the environment variable AUTOMOUNT_FIX-
       NAMES.  See automount(8) for more information.

SEE ALSO
       cd(1), csh(1), automount(8)



                               9 September 1987                         PWD(1)