Sometimes I have a long pathname, and want to shorten it by some precreated symlink to a directory in the pathname. Specifically, given a pathname
/path/to/file, and a symbolic link
/symlink to a directory
/path/to in the pathname, is there a command which can return an equivalent pathname
/symlink/file, to makes use of the symlink?
(optional, my focus is on the above for now) Furthermore, given a pathname, and a directory of symbolic links to directories, is there a command which can find out if there is any symlink to "a directory appearing in the pathname", and if yes, return an equivalent pathname using the symlink?