9.3.19 pwd command (outputs the path of the current directory)
Syntax
pwd [-L|-P]
Description
This command outputs the path of the current directory to the standard output.
Arguments
Specifying no options is equivalent to specifying the -L option.
- -L
-
This command outputs the path while a symbolic link is not resolved if the current directory path contains a symbolic link (a link using a file that contains the actual file path). If the -L and -P options are both specified, the option specified last takes effect.
- -P
-
If the current directory is the path including a symbolic link, this command outputs the path with the symbolic link resolved. If the -L and -P options are both specified, the option specified last takes effect.
Return codes
Return code |
Meaning |
---|---|
0 |
Normal termination |
1 |
Error termination |
Notes
In Windows, when you execute the pwd command, the directory delimiter / is displayed as \.
Even if the command syntax of this regular built-in command is invalid, it does not exit the shell that is executing the command.
Example
Output the path of the current directory.
Contents of the job definition script
cd /tmp pwd
Contents of the STDOUT file of the execution job
******** JOB SCOPE STDOUT ******** /tmp