Thanks to all who helped point me towards realpath(). I have another favour to ask: Is there a function that can take two absolute paths and generate a relative path, from source to destination? /usr/bin/false /bin Becomes: ../../bin /bin /usr/bin/false Becomes: ../usr/bin/false thanks, MC