diff --git a/client/gridfs.cpp b/client/gridfs.cpp
index d740c76..c57d25b 100644
--- a/client/gridfs.cpp
+++ b/client/gridfs.cpp
@@ -168,6 +168,15 @@ namespace mongo {
         }
     }
 
+    void GridFS::renameFile( const string& fileName, const string & targetFileName ){
+        _client.update( _filesNS.c_str(),       
+                        BSON( "filename" << fileName ), 
+                        BSON( "$set" << BSON( "filename" << targetFileName ) ),
+                        0,   /* not an upsert */
+                        1   /* multi enabled */
+                       );
+    }
+
     GridFile::GridFile( GridFS * grid , BSONObj obj ){
         _grid = grid;
         _obj = obj;
diff --git a/client/gridfs.h b/client/gridfs.h
index 1c55f79..6e7b295 100644
--- a/client/gridfs.h
+++ b/client/gridfs.h
@@ -95,6 +95,15 @@ namespace mongo {
          */
         void removeFile( const string& fileName );
 
+
+        /**
+         * renames files referenced by fileName in the db to targetFileName
+         * @param fileName filename (in GridFS) of the file to rename
+         * @param targetFileName filename to rename files to
+         */
+        void renameFile( const string& fileName, const string& targetFileName );
+
+
         /**
          * returns a file object matching the query
          */
diff --git a/tools/files.cpp b/tools/files.cpp
index 0d43e08..56bbe63 100644
--- a/tools/files.cpp
+++ b/tools/files.cpp
@@ -38,10 +38,11 @@ public:
             ( "local,l", po::value<string>(), "local filename for put|get (default is to use the same name as 'gridfs filename')")
             ( "type,t", po::value<string>(), "MIME type for put (default is to omit)")
             ( "replace,r", "Remove other files with same name after PUT")
+            ( "target", po::value<string>(), "target file name for RENAME")
             ;
         add_hidden_options()
-            ( "command" , po::value<string>() , "command (list|search|put|get)" )
-            ( "file" , po::value<string>() , "filename for get|put" )
+            ( "command" , po::value<string>() , "command (list|search|put|get|remove|rename)" )
+            ( "file" , po::value<string>() , "filename for search|put|get|remove|rename" )
             ;
         addPositionArg( "command" , 1 );
         addPositionArg( "file" , 2 );
@@ -50,14 +51,15 @@ public:
     virtual void printExtraHelp( ostream & out ){
         out << "usage: " << _name << " [options] command [gridfs filename]" << endl;
         out << "command:" << endl;
-        out << "  one of (list|search|put|get)" << endl;
+        out << "  one of (list|search|put|get|delete|rename)" << endl;
         out << "  list - list all files.  'gridfs filename' is an optional prefix " << endl;
         out << "         which listed filenames must begin with." << endl;
-        out << "  search - search all files. 'gridfs filename' is a substring " << endl;
-        out << "           which listed filenames must contain." << endl;
+        out << "  search - search all files. 'gridfs filename' is a regex" << endl;
+        out << "           which listed filenames must match." << endl;
         out << "  put - add a file with filename 'gridfs filename'" << endl;
         out << "  get - get a file with filename 'gridfs filename'" << endl;
         out << "  delete - delete all files with filename 'gridfs filename'" << endl;
+        out << "  rename - rename all files with filename 'gridfs filename' to target" << endl;
     }
 
     void display( GridFS * grid , BSONObj obj ){
@@ -151,6 +153,17 @@ public:
             return 0;
         }
 
+        if (cmd == "rename" ) {
+            const string &target = getParam( "target", "" );
+            if (target.length()) {
+                g.renameFile(filename, target);
+            } else {
+                cerr << "ERROR: must provide --target file with 'rename'" << endl;
+            }
+            cout << "done!" << endl;
+            return 0;
+        }
+
         cerr << "ERROR: unknown command '" << cmd << "'" << endl << endl;
         printHelp(cout);
         return -1;
