I have my own shell script files and I want to run them in terminal, keeping them in /usr/bin
folder. But my question is: which directory is best for keeping files of my own script? I want to use this files when I call my script in Terminal. /opt
, /usr/local
, e.t.c. Which is the best choise?
$HOME/bin
is probably a good place if you want to call them without directory prefix. That folder is in your path so you can run your scripts like if they were installed in/usr/bin
for example.But you can place them wherever you want, to keep your directory structure organised and optionally add those folders to
PATH
aswell.