pwd command (outputs the path of the current directory)
- Organization of this page
Format
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
-
Specifies that if the current directory path contains a symbolic link (a link using a file that contains the actual file path), the symbolic link is to be output. If the -L and -P options are both specified, the option specified last takes effect.
- -P
-
Specifies that the path that does not contain a symbolic link is to be output. If the -L and -P options are both specified, the option specified last takes effect.
In Windows, the -P option is ignored.
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.
Usage 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