I wish to know if there's any standard or recommended place to store your own custom commands (should you prefer not to install them in /usr/local/bin)?

I'm referring to small gimmicks that I, personally, don't prefer installing in /usr/local/bin for reasons such as, if I have to reformat my whole system and need to backup stuff, I won't be able to easily distinguish my own custom-made commands from the ones installed with package managers, etc.

I guess it might be up to personal choice to create something like /usr/local/mybin or similar, but is there a beaten path here that I'm not aware of? Your personal preference is also welcome.

link|improve this question
feedback

1 Answer

up vote 9 down vote accepted

The historically 'standard' place for your own binaries and scripts to go that you don't want to (or can't) install in /usr/local/[s]bin is ~/bin (i.e., the folder bin in your home directory).

You may need to add that folder to your $PATH environment variable in .bashrc, .profile or .cshrc etc depending on your shell.

link|improve this answer
I see, thanks. The one caveat might be that the bin dir would be visible in the desktop environment, which I might not prefer. Would it be recommendable practice to isolate your own executables inside /usr/local/bin, e.g. /usr/local/bin/hced/bin (hced being my username)? – hced Mar 9 '11 at 2:37
@hced: How about ~/.bin? – grawity Mar 9 '11 at 10:54
@grawity: good point, I might use that. I like conventions so I was interested to know what people do in situations when they want their own bin directory. Somehow, I get the feeling ~/.bin isn't overly common, or? Just curious. – hced Mar 10 '11 at 2:11
@hced: I also get the feeling that most people don't bother hiding ~/bin the same way they don't bother with /bin. – grawity Mar 10 '11 at 12:57
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.