I have just installed PHP5 and dependencies from the openSUSE repo onto my 13.2 64bit machine. I have also downloaded a script from github which I wish to run in a terminal. Where is the correct place to put such scripts? Is it acceptable to put php scripts into a directory already in present path or should I amend environment to include a new path?
Budgie
Up to you but think do you want this script available to all users system wide or just your user. Remember that Linux is multi-user and needs to be treated as such even if you are the only user.
If just one user needs it then put in that users ~/bin is the logical place
If system wide in /bin makes sense but you should change owner ship to root in that case but allow others or maybe just a certain group to executes it
/sbin is reserved for system type utilities so depending on what it does maybe there. But then you should only allow root execute permission.
I don’t usually put scripts in any “/bin” – I reserve those locations for binary files. I place scripts in their own folders, and usually as a subfolder of an application (like website) which usually automatically scopes and grants appropriate access automatically. I typically place system-wide applications in /opt although apps can be installed in a number of different places.
Depending on the script’s requirements, $PATH should not be an issue.
If you want the file to be found automatically without a complete full path description, then yes… Place the scripts somewhere in your existing paths or modify your $PATH accordingly.
TSU
Hi and thanks for the reply. I lean towards TSU’s approach. Also need to read up a bit on distinction between /usr/local/share/myappdirectory and /usr/share/myappdirectory.
Will edit $PATH to suit but need to sort out user/group issues. Many thanks again.
Budge