How to get the full path of a file in Linux

readlink -f <relative path>

For example:

readlink -f ./test/filename.txt outputs:
/tmp/test/filename.txt

Leave a Reply

Your email address will not be published. Required fields are marked *