Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 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 ?


migration rejected from Jun 23 '15 at 19:23

This question came from our site for professional and enthusiast programmers. Votes, comments, and answers are locked due to the question being closed here, but it may be eligible for editing and reopening on the site where it originated.

closed as primarily opinion-based by random Jun 23 '15 at 19:23

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.

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
up vote 16 down vote accepted

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


in .bashrc.


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.


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


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.


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