How do I link drush to my drupal site thats hosted via localhost?
There are several ways to tell Drush which Drupal site you would like it to operate on.


Run Drush from the directory that contains the Drupal site's settings.php file.

$ cd /path/to/drupal_root/sites/default
$ drush status

Pass --root and --uri options that identify the site:

$ drush --root=/path/to/drupal_root --uri=http://mysite.dev status

Create a site alias, and use that

$ drush @mysite status

In order to use the last option, you must define the mysite alias as described in the example aliases file.


UPDATE:

The --uri option is used (a) to select which settings.php to use, and (b) to set the $_SERVER superglobal. If your settings.php file is in the default directory, then --uri is not necessary to bootstrap. However, some modules will expect the URI to be set up correctly; in some instances, you will not get the correct results if this setting is omitted.