This is a read-only archive!

~/bin ?

I was looking through $PATH today, and trying to figure out what everything was. From what I recall, and what I've googled:

  • /sbin: system binaries.
  • /bin: single-user mode essential binaries.
  • /usr/bin: multi-user mode non-essential binaries (for all users to enjoy).
  • /usr/sbin: non-essential system binaries?
  • /usr/local/bin: binaries intended for all users, which are not installed via the package manager?
  • /usr/local/sbin: system binaries installed by some means other than the package manager?
  • /opt/bin: non-essential multi-user static binaries?`

KDE also seems to pollute my $PATH. I'd remove it, if I wasn't sure it was going to break KDE somehow. It's probably that way for a reason.

Question: Following the above "rules", is there a "standard" place to put multi-user mode, single-user non-essential binaries? i.e. say I write a script to check my mail; I want to run it, but not anyone else who uses this computer. Where does it go?

Of course one answer is "This is Linux, put it anywhere you want, fool". But I wonder if there's a convention that others follow. ~/bin would seem to follow the pattern. But I don't like polluting my ~ with directories unless I have to. And my ~ doesn't otherwise mirror /. ~/.bin would be hidden but I'm always afraid to make hidden directories in ~ just in case some program uses a directory with that name for its own config files.

If I can't think of anything else I'm just going to put all my personal scripts into ~/.sammich.

July 14, 2007 @ 10:13 AM PDT
Cateogory: Programming
Tags: Linux

4 Comments

gregf
Quoth gregf on July 14, 2007 @ 10:37 AM PDT

All my code related items are under ~/code. I do have ~/code/bin in my path. Helps keep ~/ less cluttered with just one directory instead of 3 or 4. Under code I also have directories for scm check outs, Rails projects, some old PHP projects, etc.. Also open to better ideas.

tante
Quoth tante on July 14, 2007 @ 10:41 AM PDT

I use a ~/bin directory for user scripts, if it's worth anything I either copy it to /usr/local/bin or hack together a quick ebuild to place it properly.

btw. /opt is, from what I can see, often used for binary blogs (often commercial software like vmware and the likes) so someone might link the actual binaries to /opt/bin just to make sure only those really willing to run blobs do?

Brian
Quoth Brian on July 14, 2007 @ 10:45 AM PDT

~/code/bin sounds like a good possibility.

If I had anything major enough to write an ebuild I'd probably go that route too. So it'd at least be version controlled and uninstall would be handled right.

Jay K
Quoth Jay K on July 16, 2007 @ 8:34 AM PDT

I have a ~/local. I put little script I write in ~/local/bin. And the few projects whose development I follow and build by hand, I configure with --prefix=$HOME/local, so I can make install them without worrying about them messing up my nice filesystem (puts files in ~/local/(bin|include|lib|share),etc. Works well for me.