Remix.run Logo
impoppy 9 hours ago

Why so many people use ~/bin/? What’s wrong with ~/.local/bin?

mathfailure 5 hours ago | parent | next [-]

People tend to want some separation between what's theirs and what's others. Other programs/scripts quite often put something into ~/.local/bin, so it's not yours actually, it's theirs.

1313ed01 9 hours ago | parent | prev | next [-]

Random things are installed in ~/.local/bin. In ~/bin I have only what I put there.

mixmastamyk 3 hours ago | parent [-]

Python and rust (for example) package managers install user wide tools there.

gucci-on-fleek 6 hours ago | parent | prev | next [-]

I personally use both, each for different purposes.

I snapshot my entire home directory every hour (using btrfs+snapper), but I exclude ~/.local/ from the snapshots. So I use ~/.local/bin/ for third-party binaries, since there's no reason to back those up; and ~/bin/ for scripts that I wrote myself, since I definitely want to back those up.

This is a pretty idiosyncratic use though, so I'd be surprised if many other people treated both directories this way.

aniou 5 hours ago | parent | prev | next [-]

I prefer ~/bin/ for my scripts, links to specific commands, etc.

~/.local/bin is tedious to write, when I want to see directory content and - most important - I treat whole ~/.local/ as managed automatically by other services and volatile.

maleldil 7 hours ago | parent | prev | next [-]

I use ~/.local/bin for installed programs, and ~/bin for my own scripts.

kps 7 hours ago | parent | prev | next [-]

Personally I use ~/opt//bin where ~/opt is a ‘one stop shop’ containing various things, including a symlink to ~/local and directories or symlinks for things that don't play well with others (e.g. cargo, go), and an ~/opt/prefer/bin that goes at the start of PATH containing symlinks to resolve naming conflicts.

(Anything that modifies standard behaviour is not in PATH, but instead a shell function present only in interactive shells, so as not to break scripts.)

Unix lore: Early unix had two-letter names for most common names to make them easy to type on crappy terminals, but no one* letter command names because the easier were reserved for personal use.

lupire 7 hours ago | parent [-]

What's the difference between opt and local?

I thought was for mixin externally provided systems like Homebrew, local is for machine or org-level customizations, and ~ is for user-level customizations.

kps 6 hours ago | parent [-]

/opt showed up as a place for packaged software, where each package (directory) has its own bin/, lib/, man/, and so on, to keep it self-contained rather than installing its files in the main hierarchy. ~/opt is just a per-user equivalent, analogous to /usr/local vs ~/.local.

The advantage of /opt is that multi-file software stays together. The disadvantage is that PATHs get long.

pmarreck 7 hours ago | parent | prev | next [-]

The latter is XDG.

~/bin predates it.

And of course you can use both.

xorcist 7 hours ago | parent | prev | next [-]

Why would you want to store your binaries in a hidden directory?

It kind of goes against the idea why dotfiles are dot-prefixed.

dark-star 9 hours ago | parent | prev | next [-]

~/bin/ preceeds the XDG Base Directory Specification.

~/.local was only invented around 2003 and gained widespread usage maybe 15 years or so ago...

People used ~/bin already in the 90s ;-)

zhouzhao 9 hours ago | parent | prev [-]

Nothing. I also use `~/.local/bin/`