A. To get physical path use realpath command. The realpath command uses the realpath() function to resolve all symbolic links, extra / characters and references to /./ and /../ in path. This is useful for shell scripting and security related applications.
realpath examples
Resolve symbolic link:$ realpath /home
Sample output:
/usr/homeRemove characters:
$ realpath /etc//apache/.
$ realpath ./foo
$ realpath /../some/where///./../path/
realpath includes with many distro and UNIX operating system such as FreeBSD. To install realpath under Debian / Ubuntu Linux, enter:
$ sudo apt-get install realpath
readlink command
Please note that mostly the same functionality is provided by the -f option of the readlink command:$ readlink -f /home
No comments:
Post a Comment