Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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

Is it a bad idea to keep scripts in /root? Simple bash scripts that have the following permissions:


They execute fine when ran as root, but is this bad practice? It's a multi-user system, that needs sudo to execute the scripts in question when not logged in as root....

share|improve this question

closed as primarily opinion-based by slm, Timo, Anthon, Zelda, strugee Feb 23 '14 at 7:55

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 3 down vote accepted

There is no one answer to your question as you can put them anywhere you like. It's a matter of taste and (aesthetic) opinion which do not boil down to one single correct answer.

I'd probably put them somewhere under /usr/local. For scripts meant to be run only by the superuser, I'd probably put them in /usr/local/sbin. For scripts meant to be used regular users of your system, I'd put them in /usr/local/bin.

From a historical perspective /usr/local still sounds like a good place to put things which are, eh, "local".

share|improve this answer
Would the permissions need to be changed if I were to put them in /usr/local? I take it they would if a user other than root would want to execute them? – nom Feb 23 '14 at 5:10
Proper permissions for executable scripts have the executable bit set, so 0755 sounds appropriate in this case. See also the answer for where to put things for superuser and where to put things for the rest of the bunch. – Sami Laine Feb 23 '14 at 6:24

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