pwd command

19.1 'pwd': Print working directory
===================================

Because most shells have a built-in 'pwd' command, using an unadorned
'pwd' in a script or interactively may get you different functionality
than that described here.

'pwd' prints the name of the current directory. Synopsis:

pwd [OPTION]...

The program accepts the following options. Also see *Note Common
options::.

'-L'
'--logical'
If the contents of the environment variable 'PWD' provide an
absolute name of the current directory with no '.' or '..'
components, but possibly with symbolic links, then output those
contents. Otherwise, fall back to default '-P' handling.

'-P'
'--physical'
Print a fully resolved name for the current directory. That is,
all components of the printed name will be actual directory
names--none will be symbolic links.

If '-L' and '-P' are both given, the last one takes precedence. If
neither option is given, then this implementation uses '-P' as the
default unless the 'POSIXLY_CORRECT' environment variable is set.

An exit status of zero indicates success, and a nonzero value
indicates failure.

No comments:

Post a Comment