For example, in Ubuntu, there is always a .local
directory in the home directory and .profile
includes this line:
PATH="$HOME/bin:$HOME/.local/bin:$PATH"
$HOME/.local/bin
does not exist by default, but if it is created it's already in $PATH
and executables within can be found.
This is not exactly mentioned in the XDG directory specification but seems derived from it.
What I wonder is if this is common enough that it could be usually assumed to exist in the most common end user distributions. Is it, for instance, in all of the Debian derivatives, or at least the Ubuntu ones? How about the Red Hat/Fedora/CentOS ecosystem? And so on with Arch, SUSE, and what people are using nowadays.
To be extra clear, this is only for $HOME/.local/bin
, not $HOME/bin
.
Out of curiosity, feel free to include BSDs, OS/X and others if you have the information. :)
/etc/skel/.profile
up to and including at least 14.04 tests for the presence of a user's$HOME/bin
and adds it to thePATH
if it exists; in contrast, 16.04 appears to add both$HOME/bin
and$HOME/.local/bin
unconditionally. I don't recall earlier Ubuntus adding$HOME/.local/bin
at all - but I don't see anything relevant in thebash
package changelog (which supposedly owns/etc/skel/.profile
).$HOME/.local/bin
added toPATH
by default.~/.local/bin
in/etc/skel/.profile
— but that doesn't help if you version your dot files & re-install them into all new accounts for decades on end. Thus, I've been manually adding it (PATH=~/.local/bin:"$PATH"
), ever since starting python stuff (initially very surprised that python ecosystem chose to use a hidden~/.local/
for binaries🤷♂️)