Shared publicly  - 
Pádraig Brady originally shared:
I added a new command to coreutils; realpath.
Not a decision to be taken lightly, but I think the interface is a good cohesive exportation of canonicalize_file_name(3). It's compatible with the versions already in FreeBSD and Debian, and improves on them if I say so myself. Any suggestions (before the imminent coreutils release) are appreciated:

Usage: realpath [OPTION]... FILE...
Print the resolved absolute file name;
all but the last component must exist

-e, --canonicalize-existing all components of the path must exist
-m, --canonicalize-missing no components of the path need exist
-L, --logical resolve `..' components before symlinks
-P, --physical resolve symlinks as encountered (default)
-q, --quiet suppress most error messages
--relative-to=FILE print the resolved path relative to FILE
--relative-base=FILE print absolute paths unless paths below FILE
-s, --strip don't expand symlinks
-z, --zero separate output with NUL rather than newline
Add a comment...