logoalt Hacker News

impoppyyesterday at 11:40 AM10 repliesview on HN

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


Replies

mathfailureyesterday at 3:35 PM

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.

1313ed01yesterday at 12:01 PM

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

gucci-on-fleekyesterday at 2:25 PM

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.

maleldilyesterday at 2:03 PM

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

aniouyesterday at 4:08 PM

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.

kpsyesterday at 1:50 PM

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.

show 1 reply
pmarreckyesterday at 1:35 PM

The latter is XDG.

~/bin predates it.

And of course you can use both.

xorcistyesterday at 1:58 PM

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-staryesterday at 11:48 AM

~/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 ;-)

zhouzhaoyesterday at 11:44 AM

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