I wrote a simple script with the extension .sh in my home directory that I can just run right in my home directory, but I want to run the script from every directory that I am in.  What should I do?   
how to execute a shell script from any directory
shell script
Interactively, you can always run your scripts by typing ~/yourscript.sh on the command line, but that's very limiting, especially if you want to write more scripts that call the scripts you've already written.A more integrated and flexible approach involves putting all your scripts into one directory and adding that directory to your PATH environment variable.After you do that, you'll be able to type yourscript.sh, and no matter which directory you're in, the shell will find your script and execute it.This is how it's usually done:Make a bin directory under your home directory and mv your scripts into it.Change all the scripts to executable (chmod +x).Ensure that your PATH environment variable contains your $HOME/bin directory. On some systems, the default ~/.profile will add your $HOME/bin directory to the PATH automatically, so check your ~/.profile before modifying.Let me illustrate with some script:mkdir ~/binmv ~/*.sh ~/binchmod +x ~/bin/*if ! grep 'PATH=.*HOME/bin' ~/.profilethen    echo 'export PATH=$HOME/bin:$PATH' >> ~/.profilefi. ~/.profileecho $PATH      # you should see your bin directorycd /tmp           # change to another random directorytype myscript.sh  # see if the shell finds your scriptsIf you see your bin directory in your PATH, then it's a good idea to logout and log back in and change to another directory and execute type yourscript.sh again to make sure everything is setup correctly.