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-05-29 15:24:17.869515800 +0530
@@ -77,6 +77,7 @@
   {"*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
@@ -390,6 +391,7 @@
   ParameterError err;
   bool toggle = TRUE; /* how to switch boolean options, on or off. Controlled
                          by using --OPTION or --no-OPTION */
+  static struct getout *_url;
 
 
   if(('-' != flag[0]) ||
@@ -518,6 +520,11 @@
         config->writeenv = toggle;
         break;
 #endif
+      case 'O': /* --no-clobber */
+        if(!toggle) {
+          _url->flags = _url->flags | GETOUT_OUTFILE_NOOVERWRITE;
+        }
+        break;
       case 'F': /* --dns-servers */
         /* IP addrs of DNS servers */
         GetStr(&config->dns_servers, nextarg);
@@ -1525,6 +1532,8 @@
         /* there was no free node, create one! */
         url = new_getout(config);
 
+      _url = url;
+      
       if(!url)
         return PARAM_NO_MEM;
       else {
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-05-29 15:14:57.680539094 +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-05-29 15:25:38.024581274 +0530
@@ -44,6 +44,7 @@
 #endif
 
 #include "rawstr.h"
+#define EXTRACHARS 10
 
 #define ENABLE_CURLX_PRINTF
 /* use our own printf() functions */
@@ -187,6 +188,45 @@
 }
 #endif /* __VMS */
 
+/* function to check the existence of a file*/
+static bool fileexists(const char *outfile)
+{
+  bool fileisthere = FALSE;
+  int fp = open(outfile, O_RDONLY);
+  if(fp > 0) {
+    fileisthere = TRUE;
+    close(fp);
+  }
+  return fileisthere;
+}
+
+/* 
+ * Function to return the new file name on the basis of criterion set for file
+ * overwriting.
+ */
+static char* returnnewfilename(const char* outputfilename)
+{
+  int i;
+  int newfilenamelength = strlen(outputfilename) + EXTRACHARS;
+  char *outputfilenamenew = malloc(newfilenamelength);
+  snprintf(outputfilenamenew,newfilenamelength,"%s",outputfilename);
+  for(i = 1; (fileexists(outputfilenamenew) && i < INT_MAX); i++) {
+    snprintf(outputfilenamenew,newfilenamelength,"%s.%d",outputfilename,i);
+    /* Purpose: This is used to convert the values into * char array and
+     ** creating  the appropriate filename as per according to rules.
+    * * */
+  }
+  if(outputfilename) {
+    free(outputfilename);
+  }
+  if(i >= INT_MAX && fileexists(outputfilenamenew)) {
+    return NULL; /* only filename.(INTMAX-1) filenames are */
+  }
+  outputfilename = strdup(outputfilenamenew);
+  free(outputfilenamenew);
+  return outputfilename;
+}
+
 static CURLcode operate_do(struct GlobalConfig *global,
                            struct OperationConfig *config)
 {
@@ -541,6 +581,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 = returnnewfilename(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 +611,15 @@
             /* 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 = returnnewfilename(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-05-29 15:14:57.680539094 +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.
