An absolute or relative pathname of the directory that shall become the new working directory. The
interpretation of a relative pathname by cd depends on the -L option and the CDPATH and PWD
environment variables. If directory is an empty string, the results are unspecified.
- When a hyphen is used as the operand, this shall be equivalent to the command:
cd "$OLDPWD" && pwd
which changes to the previous working directory and then writes its name.
AND and OR lists are sequences of one of more pipelines separated by the && and || control operators,
respectively. AND and OR lists are executed with left associativity. An AND list has the form
command1 && command2
command2 is executed if, and only if, command1 returns an exit status of zero.
An OR list has the form
command1 || command2
command2 is executed if and only if command1 returns a non-zero exit status. The return status of AND
and OR lists is the exit status of the last command executed in the list.