What is the difference between local and .local in ubuntu?

Echoing path in ubuntu returns following colon separated paths,

/home/stack/bin:/home/stack/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

In these paths at some places there is local while at others .local is used what is the difference between both?


Note that the .local is used in only one place: inside your home directory. The others are all /usr/local. /usr/local is where programs installed outside of the package manager are supposed to add things, so various folders in it are added to PATH by default.

~/.local is analogous to /usr/local, but for programs installing (or otherwise writing data) to your home directory (for example, pip), so .local/bin is also added to PATH. The directory structure in .local is similar to that of /usr/local, which in turn is like that of /usr.

For more information, see:

  • Differences between /bin, /sbin, /usr/bin, /usr/sbin, /usr/local/bin, /usr/local/sbin
  • How to understand the Ubuntu file system layout?

in this particular case, local is a visible directory, and .local is a hidden directory. you can see list of all hidden directory and/or files in a certain directory using ls -a or ls .* command.