Canonical absolute path

/ Published in: Bash
Save to your folder(s)

The following shell function returns the canonicalised abolute path of a file. It resolves symbolic links, /./ and /../ as applicable. This was adapted from various sources. Related snippets on snipplr are [Find absolute path of Bash script]( and [Get current script name and absolute paths](

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.