diff --git a/docs/commands.html b/docs/commands.html
index d8cf7df..9c1a077 100644
--- a/docs/commands.html
+++ b/docs/commands.html
@@ -40,6 +40,10 @@ Drush searches for commandfiles in the following locations:
 <li>The ".drush" folder in the user's HOME folder.
 
 <li>All modules in the current Drupal installation
+
+<li>Folders and files containing other versions of drush in their names will
+be *skipped* (e.g. devel.drush4.inc or drush4/devel.drush.inc).  Names
+containing the current version of drush (e.g. devel.drush5.inc) will be loaded.</li>
 </ul> <p>
 Note that modules in the current Drupal installation will only
 be considered if drush has bootstrapped to at least the DRUSH_BOOSTRAP_SITE
diff --git a/examples/example.aliases.drushrc.php b/examples/example.aliases.drushrc.php
index f56a797..fc132da 100644
--- a/examples/example.aliases.drushrc.php
+++ b/examples/example.aliases.drushrc.php
@@ -47,6 +47,11 @@
  *      or any local Drupal site indicated by an alias used as
  *      a parameter to a command
  *
+ * Folders and files containing other versions of drush in their names will
+ * be *skipped* (e.g. mysite.aliases.drush4rc.php or drush4/mysite.aliases.drushrc.php).
+ * Names containing the current version of drush (e.g. mysite.aliases.drush5rc.php)
+ * will be loaded.
+ *
  * Files stored in these locations can be used to create aliases
  * to local and remote Drupal installations.  These aliases can be
  * used in place of a site specification on the command line, and
diff --git a/examples/example.drushrc.php b/examples/example.drushrc.php
index 4e5a35e..467cdf6 100644
--- a/examples/example.drushrc.php
+++ b/examples/example.drushrc.php
@@ -1,8 +1,8 @@
 <?php
 
 /**
- * Examples of valid statements for a drushrc.php file. Use this file to cut down on
- * typing of options and avoid mistakes.
+ * Examples of valid statements for a drushrc.php file. Use this file to
+ * cut down on typing of options and avoid mistakes.
  *
  * Rename this file to drushrc.php and optionally copy it to one of
  * five convenient places, listed below in order of precedence:
@@ -18,6 +18,13 @@
  * will be loaded and merged with other configuration files in the
  * search list.
  *
+ * If you have some configuration options that are specific to a
+ * particular version of drush, then you may place them in a file
+ * called drush5rc.php.  The version-specific file is loaded in
+ * addtion to, and after, the general-purpose drushrc.php file.
+ * Version-specific configuration files can be placed in any of the
+ * locations specified above.
+ *
  * IMPORTANT NOTE on configuration file loading:
  *
  * At its core, drush works by "bootstrapping" the Drupal environment
@@ -87,6 +94,10 @@
 // Separate by : (Unix-based systems) or ; (Windows).
 # $options['i'] = 'sites/default:profiles/myprofile';
 
+// Specify modules to ignore when searching for *.drush.inc files
+// inside a Drupal site
+# $options['ignored-modules'] = array('module1', 'module2');
+
 // Specify additional directories to search for *.alias.drushrc.php
 // and *.aliases.drushrc.php files
 # $options['alias-path'] = '/path/to/aliases:/path2/to/more/aliases';
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index 35e4e45..eba7f6b 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -956,6 +956,8 @@ function drush_bootstrap_prepare() {
 
   $drush_info = drush_read_drush_info();
   define('DRUSH_VERSION', $drush_info['drush_version']);
+  $version_parts = explode('.', DRUSH_VERSION);
+  define('DRUSH_MAJOR_VERSION', $version_parts[0]);
 
   define('DRUSH_REQUEST_TIME', microtime(TRUE));
 
diff --git a/includes/command.inc b/includes/command.inc
index bd5b34c..a52bc81 100644
--- a/includes/command.inc
+++ b/includes/command.inc
@@ -257,7 +257,7 @@ function _drush_verify_cli_options($command) {
     $implemented = drush_get_commands();
     foreach ($command['allow-additional-options'] as $subcommand_name) {
       if (array_key_exists($subcommand_name, $implemented)) {
-	$options = array_merge($options, _drush_get_command_options($implemented[$subcommand_name])); 
+	$options = array_merge($options, _drush_get_command_options($implemented[$subcommand_name]));
       }
     }
   }
@@ -1070,7 +1070,8 @@ function _drush_find_commandfiles($phase, $phase_max = FALSE) {
     case DRUSH_BOOTSTRAP_DRUPAL_FULL:
       // Add enabled module paths. Since we are bootstrapped,
       // we can use the Drupal API.
-      foreach (module_list() as $module) {
+      $ignored_modules = drush_get_option_list('ignored-modules', array());
+      foreach (array_diff(module_list(), $ignored_modules) as $module) {
         $filename = drupal_get_filename('module', $module);
         $searchpath[] = dirname($filename);
       }
@@ -1106,7 +1107,8 @@ function _drush_add_commandfiles($searchpath, $phase = NULL, $reset = FALSE) {
       // Scan for drush command files; add to list for consideration if found.
       foreach (array_unique($searchpath) as $path) {
         if (is_dir($path)) {
-          $files = drush_scan_directory($path, '/\.drush\.inc$/', array('.', '..', 'examples', 'tests', 'disabled', 'gitcache'));
+          $nomask = array_merge(drush_filename_blacklist(), drush_get_option_list('ignored-modules'));
+          $files = drush_scan_directory($path, '/\.drush(' . DRUSH_MAJOR_VERSION . '|)\.inc$/', $nomask);
           foreach ($files as $filename => $info) {
             $module = basename($filename, '.drush.inc');
             // Only try to bootstrap modules that we have never seen before, or that we
@@ -1167,6 +1169,13 @@ function _drush_add_commandfiles($searchpath, $phase = NULL, $reset = FALSE) {
 }
 
 /**
+ * Substrings to ignore during commandfile searching.
+ */
+function drush_filename_blacklist() {
+  return array_diff(array('.', '..', 'examples', 'tests', 'disabled', 'gitcache', 'drush4', 'drush5', 'drush6', 'drush7'), array('drush' . DRUSH_MAJOR_VERSION));
+}
+
+/**
  * Conditionally include files based on the command used.
  *
  * Steps through each of the currently loaded commandfiles and
diff --git a/includes/context.inc b/includes/context.inc
index b78f68d..f8fde28 100644
--- a/includes/context.inc
+++ b/includes/context.inc
@@ -93,9 +93,10 @@ function drush_context_names() {
  *   The keys are the 'context' of the files, the values are the file
  *   system locations.
  */
-function _drush_config_file($context, $prefix = NULL) {
+function _drush_config_file($context, $prefix = NULL, $version = '') {
   $configs = array();
-  $config_file = $prefix ? $prefix . '.' . 'drushrc.php' : 'drushrc.php';
+  $base_name = 'drush' . $version . 'rc.php';
+  $config_file = $prefix ? $prefix . '.' . $base_name : $base_name;
 
   // Did the user explicitly specify a config file?
   if ($config = drush_get_option(array('c', 'config'))) {
@@ -138,6 +139,7 @@ function _drush_config_file($context, $prefix = NULL) {
  */
 function drush_load_config($context) {
   drush_load_config_file($context, _drush_config_file($context));
+  drush_load_config_file($context, _drush_config_file($context, '', DRUSH_MAJOR_VERSION));
 }
 
 function drush_load_config_file($context, $config) {
diff --git a/includes/drush.inc b/includes/drush.inc
index 09a5a4d..7e4a664 100644
--- a/includes/drush.inc
+++ b/includes/drush.inc
@@ -344,6 +344,7 @@ function drush_get_global_options($brief = FALSE) {
     $options['choice']              = array('description' => "Provide an answer to a multiple-choice prompt.");
     $options['variables']           = array('description' => "Comma delimited list of name=value pairs. These values take precedence even over settings.php variable overrides.");
     $options['search-depth']        = array('description' => "Control the depth that drush will search for alias files.");
+    $options['ignored-modules']     = array('description' => "Exclude some modules from consideration when searching for drush command files.");
     $options['no-label']            = array('description' => "Remove the site label that drush includes in multi-site command output(e.g. `drush @site1,@site2 status`).");
     $options['nocolor']             = array('context' => 'DRUSH_NOCOLOR', 'description' => "Suppress color highlighting on log messages.");
     $options['show-passwords']      = array('description' => "Show database passwords in commands that display connection information.");
diff --git a/includes/sitealias.inc b/includes/sitealias.inc
index e11e865..6b29018 100644
--- a/includes/sitealias.inc
+++ b/includes/sitealias.inc
@@ -432,12 +432,12 @@ function _drush_sitealias_find_and_load_alias($aliasname, $alias_path_context =
   // any folder in the alias path.  The directory scan
   // is not deep, though; only files immediately in the
   // search path are considered.
-  $alias_files = array('/.*aliases\.drushrc\.php$/');
+  $alias_files = array('/.*aliases\.drush(' . DRUSH_MAJOR_VERSION . '|)rc\.php$/');
   if ($aliasname == NULL) {
-    $alias_files[] = '/.*\.alias\.drushrc\.php$/';
+    $alias_files[] = '/.*\.alias\.drush(' . DRUSH_MAJOR_VERSION . '|)rc\.php$/';
   }
   else {
-    $alias_files[] = '/' . preg_quote($aliasname, '/') . '\.alias\.drushrc\.php$/';
+    $alias_files[] = '/' . preg_quote($aliasname, '/') . '\.alias\.drush(' . DRUSH_MAJOR_VERSION . '|)rc\.php$/';
   }
 
   // Search each path in turn
@@ -445,7 +445,7 @@ function _drush_sitealias_find_and_load_alias($aliasname, $alias_path_context =
     // Find all of the matching files in this location
     $alias_files_to_consider = array();
     foreach ($alias_files as $file_pattern_to_search_for) {
-      $alias_files_to_consider = array_merge($alias_files_to_consider, array_keys(drush_scan_directory($path, $file_pattern_to_search_for, array('.', '..', 'CVS', 'examples'), 0, FALSE)));
+      $alias_files_to_consider = array_merge($alias_files_to_consider, array_keys(drush_scan_directory($path, $file_pattern_to_search_for, drush_filename_blacklist(), 0, FALSE)));
     }
 
     // For every file that matches, check inside it for
