Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am developing a set of scripts, which I want to be present for all users, when I set up a server. But I don't want them in the standard locations like /usr[/local]/[bin],[sbin] etc.

Is there some existing convention for where such scripts should be placed?

share|improve this question
1  
Possible duplicate of superuser.com/questions/185184/where-should-i-put-my-script –  user68186 Oct 2 '12 at 18:05
    
For those who may be interested there is an old usenet thread here, vb.serverknecht.de/…, which leads to something more direct giwersworld.org/computers/linux/linux-file-system.html –  vfclists Oct 2 '12 at 19:06
add comment

3 Answers 3

up vote 8 down vote accepted

As far as I know there is no place for custom Linux scripts. The directory that should be used for custom install is the /opt directory so it would be the safest option to place them there. But keep in mind that for a script to be able to be used without the full path you need it to be included in the PATH variable.

If you need help changing the PATH variable for all users you can check How do I set PATH variables for all users on a server? which refers you to the /etc/environment file to configure this.

If your concern is to avoid clashes but you don't want to add another route to the PATH variable you could use /usr/local/bin. In my server installation it doesn't have any file so that it could be a easy work-around.

Hope it helps

share|improve this answer
add comment

You could place the scripts in /opt/bin and add the location to the PATH.

See:

  1. Linux path environment variable

  2. Permanently add a directory to shell PATH

    For global use in:

    /etc/bash.bashrc
    

    or

    /etc/profile
    
share|improve this answer
    
+1 for the links. –  user68186 Oct 2 '12 at 18:25
add comment

There are several places you could put these, typically I place them in /opt/ and update PATH for each user (or globally in /etc/bash.bashrc) so it's available to users. /opt/ is more or less designed for what you're looking to do.

share|improve this answer
add comment

Your Answer

 
discard

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.