1

According to this post, $HOME/.local/bin is used to store user-specific binaries. But I see in this post that $HOME/bin serves a similar purpose.

What am I missing? When should I use one over the other?

I know about the difference between /usr/bin and /usr/local/bin. Is it the same here?

I also know about hidden directories and files.

Both work : I'm looking for a rule or a convention to help me choose one or the other.

Thank you in advance.

Haltarys
  • 113
  • 3
  • It's up to you where to store your binaries. You can create any directory you like. It doesn't matter. – Pilot6 Jan 16 '23 at 15:28

1 Answers1

0

The main difference is that $HOME/.local/bin is a hidden directory.

It doesn't matter where you store your binaries. You can store them e.g. in $HOME/binaries.

It won't change anything.

Haltarys
  • 113
  • 3
Pilot6
  • 90,100
  • 91
  • 213
  • 324
  • You can always add anything you like to $PATH. – Pilot6 Jan 16 '23 at 16:06
  • And also $HOME/bin isn't added by default. – Pilot6 Jan 16 '23 at 16:07
  • Thank you for your answer. I know about hidden directories and how adding a directory to PATH works. I was really only just looking for an explanation for a convention, what is the most UNIX/Linux-like way of doing things or if it's a unique quirk from Ubuntu. – Haltarys Jan 16 '23 at 16:10
  • If you add a directory to $PATH, you won't need to type the full path when run something. There is no "convention" for that. It is like "where do I store my photos". – Pilot6 Jan 16 '23 at 16:11
  • But /usr/bin and /usr/local/bin are both in $PATH but you're not supposed to add the same type of binary in them. /usr/bin contains system executables managed by the package manager, while /usr/local/bin contains "manually" installed executables. Both work, but it's good practice to differentiate them. – Haltarys Jan 16 '23 at 16:25
  • It doesn't matter what "type" of binary is in the $PATH. The only reason to add something there is to run binaries without entering a full path. – Pilot6 Jan 16 '23 at 16:27