This tutorial is intended to cover installing short single file scripts that you might copy from forums, it won't cover compilation and won't cover installation of programs from online repositories such as google code, they should have an INSTALL or README file with specific install instructions. For information on installing normal applications please see the package management section of Explanation of Linux.
If you plan on downloading more than one or 2 files its probably a good idea to make a directory, and add the path to your bashrc, this means if you run it from the terminal you don't have the write the full path, just the file name.
First to create a directory, In the terminal type:
mkdir ~/bin
or in the file manager PCManFM by default: right click –> create new –> directory, and then name it.
I named it bin, but you could call it script or whatever you want.
next to add it to your 'path'.
Open up the text editor (in the main menu), make sure you have selected hidden files to be shown (in Linux files prepended by a dot '.' are hidden by default), and open .bashrc .
Alternatively in the terminal:
nano ~/.bashrc
(or you favourite editor). Then somewhere, preferably nearer the bottom add:
export PATH=$PATH:~/bin
Save and exit.
To reload without restarting your computer, enter in a terminal:
source ~/.bashrc
Now you should be able to run programs in that directory without writing the full path.
Most of the scripts you get, that you haven't got from from the repositories will probably be copy and pasted from web sites, simply save them into the directory setup above, the name doesn't really matter, the extension isnt really used for scripts, Linux uses a line at the beginning of the file to identify what interpreter to use, that line will look something like #! /usr/bin/perl or #! /usr/bin/env python.
Next you need to make it executable, anything downloaded from the internet by default doesn't have execute permissions, so either an installation script, or you has to do that. To make it executable simply open a terminal and type:
chmod +x ~/bin/yourscriptname
assuming you called your directory 'bin'.
You may also see instructions telling you to do:
chmod 777 ~/bin/yourscriptname
this is basically the same, (it will add extra permissions too) but is equivalent, I find '+x' easier to remember though (add eXecute (permissions)).
Thats it, your script is ready to run.