readlink: Finding file to which a softlink pointing to

readlink is a command that can be used on a softlink to find out the file to which it is actualy pointing to. For example if we have a file “temp” which is a softlink, we can run readlink of temp as follows

$ readlink temp test

This indicates that readlink is a softlink of the file temp. If we want the full path to the file “test” we can pass the option “-f”

$ readlink -f temp /home/user/Desktop/test

Thus we can find the full path to the file to which the softlink is pointing to .


Tags: ,
Copyright 2017. All rights reserved.

Posted August 22, 2012 by Tux Think in category "Linux