Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I was just wondering - where do you usually put your shell scripts? or perl or python scripts for that matter?

Is /usr/local/scripts ok? or /opt ?

share|improve this question

migrated from stackoverflow.com Nov 22 '10 at 20:43

This question came from our site for professional and enthusiast programmers.

I think this is a pretty general question ('cause non-programming users, admins et. al. also have this problem) and am voting to migrate to Super User, but you might want to clarify what you mean by "keep". Are we talking about archiving them for the future or making them available for easy execution from the prompt (which seems to be what you answer are addressing)? –  dmckee Nov 22 '10 at 16:28

4 Answers 4

up vote 16 down vote accepted

I drop everything in $HOME/bin, and append it to my $PATH, by placing


in .bashrc.

share|improve this answer

For system-wide use, I would put them in /usr/local/bin. For per-account use, I'd put them in $HOME/bin as withoutasound suggests.

share|improve this answer

I have them in their own git repo. As soon as they are reasonably polished, I use a script to symlink them to ~/bin.

share|improve this answer

I put them in a dedicated directory under /var/tmp for at least three reasons:

  • It isn't related to any specific account
  • I can always (on regular Unix systems) create a directory there even without administrative rights
  • It normally survives a reboot

Of course, sometimes eager cleaning scripts wipe that directory off but I can easily reinstall it anyway.

For packaged stuff, I always used /opt/ as it is a standard. /usr/local/bin has several pitfalls.

share|improve this answer

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.