Em sistemas linux, você deve ter readlink do projeto GNU coreutils instalado e pode fazer isso:
readlink -f file.ext
Os sistemas Debian / ubuntu podem ter o utilitário realpath instalado que "fornece basicamente a mesma funcionalidade que /bin/readlink -f no pacote coreutils. "