Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I wrote a small bash script for starting, stopping and restarting my java applications and I want to make it available to all users so they could run it. Should I just place it in /usr/bin to do that? Is it the right place for my scripts? Isn't that for like installed package script and stuff only?

share|improve this question
up vote 10 down vote accepted

Correct, [/usr]/[s]bin is for the distro creator's use. Local user scripts belong under /usr/local, specifically /usr/local/bin in this case.

Filesystem Hierarchy Standard

share|improve this answer
Thank you for the link - that makes sense! :) – Rihards Jul 7 '11 at 0:03

I would recommend putting it in /opt. You can create directory with your application name under /opt and then bin directory under it, so your path will look like that:


Then you create two scripts in /etc/profile.d - <your_app_name>.sh and <your_app_name>.csh and in those scripts you add the path above to global $PATH variable to make executables of your app available to all users. That's all.

I think that this approach is cleaner then putting it in /usr/local/bin since all your changes to the system are localized to a single directory (with exception of two scripts in /etc/profile.d), it is easy to remove your app manually and your files do not mix with files of other applications (which may be the case with /usr/local). This approach is also compliant with "Filesystem Hierarchy Standard".

share|improve this answer

There is certainly nothing preventing you from placing a script in /usr/bin, giving it world-execute permissions (something like chmod 755) and allowing users to run it. If you want to conform with "The UNIX way" there are more appropriate locations. I'm sure I'll start a trail of comments on why this is wrong, but I'd learn towards storing it in /usr/local/bin/ instead. The /usr/local directory is typically for software not managed by the distribution directly, such as third party applications or scripts.

share|improve this answer
Actually, /usr/local is for second-party stuff. Third-party stuff goes under /opt. – Ignacio Vazquez-Abrams Jul 6 '11 at 23:47

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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