30 January 2022
In the previous post I describe the use of pwd
to know the physical directory of a symbolic link.
Another command that could be used to print value of a symbolic link or canonical file name is readlink
Note: all example below could be execute in a container:
docker run -it ubuntu /bin/bash
Example:
Create a symbolic link:
ln -s /etc/init.d/ /init.d
List all directories:
ls
bin boot dev etc home init.d lib lib32 lib64 libx32 media mnt opt proc root run sbin srv sys tmp usr var
Print value of symbolic link:
readlink /init.d
/etc/init.d
readlink --help