Contents
How do you make a script accessible from anywhere in Linux?
2 Answers
- Create yourself a directory $HOME/bin . Put all your executable scripts in it (make them executable with chmod +x script if need be††). …
- Add $HOME/bin to your PATH . I put mine at the front: PATH=”$HOME/bin:$PATH , but you could put it at the back if you prefer.
- Update your . profile or .
How do I run a shell script globally?
How to make a globally available executable script in the scripting language of your choice
- Locate the path to the interpreter for the language you are writing in with the which command. …
- Add that path as an interpreter directive (using #! ) on the first line of your script. …
- Write your script to do what you want.