It depends on what your $HOME
points to. On most properly set-up systems (every mainstream Linux distro, OSX and Windows) it'll point to an absolute path, e.g. /home/user
or C:/Users/User
. But if it's unset, improperly set or even changed manually (export HOME=.
), expanduser
may result in a relative path, in which case abspath
will further change it.
But for most intents and purposes, you can assume that yes, both expressions are equivalent.