Linux – /usr/bin/realpath not found in Centos 6.5

centoscoreutilslinux

I'm trying to type 'realpath' in CentOS 6.5.
But it seems not installed.
I checked it is contained in coreutils (archlinux).
I double check the coreutils package which provide by CentOS, it lack the /usr/bin/realpath.
I don't want to install 3rd party rpm like 'http://pkgs.org/centos-6/repoforge-x86_64/realpath-1.17-1.el6.rf.x86_64.rpm.html'.

I've did yum search realpath, can not found it.
Is the utility contains in other package? Or just be removed for security reason?

Best Answer

realpath is a very useful tool, however most of its functionalities were already present with readlink. The realpath man page states:

Please note that mostly the same functionality is provided by the '-e' option of the readlink(1) command.

And the readlink man page states:

-e, --canonicalize-existing: canonicalize by following every symlink in every component of the given name recursively, all components must exist.

The readlink command was added to coreutils, AFAIK, in 2008: it is surely available in Ubuntu Hardy 8.04. So if you do not have realpath, it is possible that you have readlink immediately available.

Related Question