How to convert relative path to absolute path in Unix

unix

Solution

`readlink -f /home/stevin/data/APP_SERVICE/../datafile.txt` should do what you're looking for, assuming your Unix/Linux has `readlink`.

Problem

I want to convert Relative Path - `/home/stevin/data/APP_SERVICE/../datafile.txt` to Absolute Path - `/home/stevin/data/datafile.txt` Is there a built-in tool in Unix to do this or any good ideas as to how can I implement this?

Original source