@JohnnyApplesauce To run a script (a script, an executable, whatever) from anywhere, the script needs to be executable (chmod +x script.sh) and it needs to be in one of the directories in the environment variable $PATH which is set in your shell's initialization files (usually ~/.profile). See here for how to add directories to your $PATH:
I'm wondering where a new path has to be added to the PATH environment variable. I know this can be accomplished by editing .bashrc (for example), but it's not clear how to do this.
This way:
export PATH=~/opt/bin:$PATH
or this?
export PATH=$PATH:~/opt/bin