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/.profileup to and including at least 14.04 tests for the presence of a user's$HOME/binand adds it to thePATHif it exists; in contrast, 16.04 appears to add both$HOME/binand$HOME/.local/binunconditionally. I don't recall earlier Ubuntus adding$HOME/.local/binat all - but I don't see anything relevant in thebashpackage changelog (which supposedly owns/etc/skel/.profile). – steeldriver Oct 16 '16 at 19:08.profile. I also remember it as being conditional earlier. – Stoffe Oct 16 '16 at 20:30$HOME/.local/binadded toPATHby default. – edwinksl Jul 05 '17 at 17:09~/.local/binin/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♂️) – michael May 20 '20 at 07:14