diff -ur orig/curl-7.37.0/src/tool_getparam.c modified/curl-7.37.0/src/tool_getparam.c
--- orig/curl-7.37.0/src/tool_getparam.c	2014-05-28 19:01:25.166540878 +0530
+++ modified/curl-7.37.0/src/tool_getparam.c	2014-06-16 17:04:50.368290319 +0530
@@ -71,12 +71,13 @@
   {"*6", "dns-ipv6-addr",            TRUE},
   {"*a", "random-file",              TRUE},
   {"*b", "egd-file",                 TRUE},
-  {"*B", "oauth2-bearer",             TRUE},
+  {"*B", "oauth2-bearer",            TRUE},
   {"*c", "connect-timeout",          TRUE},
   {"*d", "ciphers",                  TRUE},
   {"*D", "dns-interface",            TRUE},
   {"*e", "disable-epsv",             FALSE},
   {"*E", "epsv",                     FALSE},
+  {"*O", "clobber",                  FALSE},
          /* 'epsv' made like this to make --no-epsv and --epsv to work
              although --disable-epsv is the documented option */
 #ifdef USE_ENVIRONMENT
@@ -385,11 +386,13 @@
   unsigned int j;
   time_t now;
   int hit = -1;
+  static int clobberflag = 0;
   bool longopt = FALSE;
   bool singleopt = FALSE; /* when true means '-o foo' used '-ofoo' */
   ParameterError err;
   bool toggle = TRUE; /* how to switch boolean options, on or off. Controlled
                          by using --OPTION or --no-OPTION */
+  static struct getout *_url = NULL;
 
 
   if(('-' != flag[0]) ||
@@ -518,6 +521,14 @@
         config->writeenv = toggle;
         break;
 #endif
+      case 'O': /* --no-clobber */
+        if(!toggle && _url && nextarg) {
+          _url->flags = _url->flags | GETOUT_OUTFILE_NOOVERWRITE;
+        }
+        else {
+        clobberflag = clobberflag | GETOUT_OUTFILE_NOOVERWRITE;
+        }
+        break;
       case 'F': /* --dns-servers */
         /* IP addrs of DNS servers */
         GetStr(&config->dns_servers, nextarg);
@@ -1524,6 +1535,7 @@
       else
         /* there was no free node, create one! */
         url = new_getout(config);
+        _url = url;
 
       if(!url)
         return PARAM_NO_MEM;
@@ -1542,6 +1554,9 @@
         }
         url->flags |= GETOUT_OUTFILE;
       }
+      if((clobberflag & GETOUT_OUTFILE_NOOVERWRITE) && _url) {
+        _url->flags = _url->flags | GETOUT_OUTFILE_NOOVERWRITE;
+      }
     }
     break;
     case 'P':
diff -ur orig/curl-7.37.0/src/tool_help.c modified/curl-7.37.0/src/tool_help.c
--- orig/curl-7.37.0/src/tool_help.c	2014-05-28 19:01:25.166540878 +0530
+++ modified/curl-7.37.0/src/tool_help.c	2014-06-16 17:05:09.129290299 +0530
@@ -179,6 +179,8 @@
   " -J, --remote-header-name Use the header-provided filename (H)",
   " -O, --remote-name   Write output to a file named as the remote file",
   "     --remote-name-all Use the remote file name for all URLs",
+  "     --no-clobber    Don't overwrite the exisiting ,rather create",
+  "                     seperate file ,used with -o and -O options",
   " -R, --remote-time   Set the remote file's time on the local output",
   " -X, --request COMMAND  Specify request command to use",
   "     --resolve HOST:PORT:ADDRESS  Force resolve of HOST:PORT to ADDRESS",
diff -ur orig/curl-7.37.0/src/tool_operate.c modified/curl-7.37.0/src/tool_operate.c
--- orig/curl-7.37.0/src/tool_operate.c	2014-05-28 19:01:25.166540878 +0530
+++ modified/curl-7.37.0/src/tool_operate.c	2014-06-16 17:04:39.223290331 +0530
@@ -44,6 +44,7 @@
 #endif
 
 #include "rawstr.h"
+#define EXTRACHARS 10
 
 #define ENABLE_CURLX_PRINTF
 /* use our own printf() functions */
@@ -187,6 +188,48 @@
 }
 #endif /* __VMS */
 
+/*
+ * Function to check the existence of a file. Creates a file
+ * if notexisting and returns false,returns true
+ * if file is already existing.
+ *
+ */
+static bool fileexists(const char *outfile)
+{
+  bool fileisthere = TRUE;
+  int fp = open(outfile,O_CREAT|O_EXCL,00700);
+  if(fp > 0) {
+    close(fp);
+    fileisthere = FALSE;
+  }
+  return fileisthere;
+}
+
+/*
+ * Function to provide the new file name of an existing file to prevent its
+ * overwriting.
+ *
+ */
+static char* newname(const char* ofile)
+{
+  int i;
+  size_t newlen = strlen(ofile) + EXTRACHARS;
+  char *onew = malloc(newlen);
+  if(!onew)
+   return NULL;
+  snprintf(onew,newlen,"%s",ofile);
+  for(i = 1; (fileexists(onew) && i < INT_MAX); i++) {
+    snprintf(onew,newlen,"%s.%d",ofile,i);
+  }
+  if(ofile) {
+    free((char*)ofile);
+  }
+  if(i >= INT_MAX && fileexists(ofile)) {
+    return NULL; /* only filename.(INT_MAX-1) filenames allowed */
+  }
+  return onew;
+}
+
 static CURLcode operate_do(struct GlobalConfig *global,
                            struct OperationConfig *config)
 {
@@ -541,6 +584,15 @@
           if(!outfile) {
             /* extract the file name from the URL */
             res = get_url_file_name(&outfile, this_url);
+            if(urlnode->flags & GETOUT_OUTFILE_NOOVERWRITE) {
+              if(fileexists(outfile)) {
+                outfile = newname(outfile);
+                if(outfile == NULL) {
+                  helpf(global->errors,"all possible filenames exhausted");
+                  goto quit_curl;
+                }
+              }
+            }
             if(res)
               goto show_error;
             if((!outfile || !*outfile) && !config->content_disposition) {
@@ -562,6 +614,16 @@
             /* fill '#1' ... '#9' terms from URL pattern */
             char *storefile = outfile;
             res = (CURLcode) glob_match_url(&outfile, storefile, urls);
+            if(urlnode->flags & GETOUT_OUTFILE_NOOVERWRITE) {
+              if(fileexists(outfile)) {
+                outfile = newname(outfile);
+                if(outfile == NULL) {
+                  helpf(global->errors,"all possible filenames exhausted");
+                  goto quit_curl;
+                }
+              }
+            }
+
             Curl_safefree(storefile);
             if(res) {
               /* bad globbing */
diff -ur orig/curl-7.37.0/src/tool_sdecls.h modified/curl-7.37.0/src/tool_sdecls.h
--- orig/curl-7.37.0/src/tool_sdecls.h	2014-05-28 19:01:25.166540878 +0530
+++ modified/curl-7.37.0/src/tool_sdecls.h	2014-06-16 17:05:00.683290307 +0530
@@ -114,6 +114,8 @@
 #define GETOUT_UPLOAD     (1<<3)  /* if set, -T has been used */
 #define GETOUT_NOUPLOAD   (1<<4)  /* if set, -T "" has been used */
 #define GETOUT_METALINK   (1<<5)  /* set when Metalink download */
+#define GETOUT_OUTFILE_NOOVERWRITE (1<<6)
+/* set when we apply check for overwriting the exisiting file*/
 
 /*
  * 'trace' enumeration represents curl's output look'n feel possibilities.
