23 January 2022
pwd
is a command to show the current working directory.
There is also an environment variable ${PWD}
that could be used to print the current working directory.
Note: all example below could be execute in a container:
docker run -it ubuntu /bin/bash
Example:
pwd
/
or
echo ${PWD}
/
In case of symbolic link could be used to retrieve the physical directory:
ln -s /etc/init.d/ /init.d
cd /init.d
pwd
/init.d
-P
parameter show the physical directory
pwd -P
/etc/init.d
pwd --help