7

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?

muru
  • 197,895
  • 55
  • 485
  • 740
  • local is a folder; .local is a hidden folder. –  Nov 21 '17 at 05:56
  • Hey thanks, and are they same folders, hidden in one case and visible in other? Or they are completely different? What is the reason for hiding local in later case? – Anam Nizami Nov 21 '17 at 06:35
  • Obviously not the same folders. Example: /home/stack/.local and /usr/local The reason for hiding is because typically those folders are at your home but aren't for you to use, just to store configs and such. –  Nov 21 '17 at 06:45
  • For more info about local folders in general, see What is /usr/local/bin? – wjandrea Nov 21 '17 at 06:51

3 Answers3

10

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:

Olorin
  • 3,488
3

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.

arryph
  • 629
2

Files and directories with a preceding . are hidden items.

wjandrea
  • 14,236
  • 4
  • 48
  • 98
guyd
  • 955