Yes you do (or a suitable alternative, e.g. GNU readlink).
> The `cd` into the directory + `pwd` is equivalent.
You won't know which directory to cd to without realpath. Just stripping off the filename does not get you the correct directory if the file itself is a symlink, which is a common use case.
Yes you do (or a suitable alternative, e.g. GNU readlink).
> The `cd` into the directory + `pwd` is equivalent.
You won't know which directory to cd to without realpath. Just stripping off the filename does not get you the correct directory if the file itself is a symlink, which is a common use case.