The Basics

Shell Scripts

There are hundreds (if not thousands) of Web pages devoted to Linux Shell Scripting. So, for more detailed explanations of what I’ve illustrated here, please visit those pages. A few links are provided here:

Now onto my tips.

Create a “bin” directory/folder in your home directory to house your Shell Scripts. From a Terminal session type:

mkdir bin

From the same Terminal session, list the contents of your home directory:


You should see the “bin” folder listed there.

Check the PATH:

echo $PATH

Hopefully you find /home/yourserid/bin: somewhere in the display. If not, you will need to preface your Shell Script filename with “./bin/” in order to run it.

Create a test Shell Script using your favorite Text Editor:

echo "Hello World from $USER."

Save it as “”, then in the Terminal window make it executable:

cd bin
chmod 775

Navigate back to your “home” directory:

cd ..

Then run it:

(Remember, if /home/youruserid/bin is not in your System’s PATH, you will need to type ./bin/