diff -ur grep.pristine/doc/grep.1 grep.patched.2/doc/grep.1
--- grep.pristine/doc/grep.1	2008-02-07 03:43:27.000000000 +0000
+++ grep.patched.2/doc/grep.1	2008-08-12 20:18:37.602133518 +0100
@@ -243,6 +243,22 @@
 .I NUM
 non-matching lines.
 .TP
+.BI \-\^\-min-count= NUM
+When printing a count of matching lines for each input file
+.B (\-c 
+or
+.B \-\^\-count
+option), only print files with at least
+.I NUM
+matching lines.
+With the
+.B \-v
+or
+.B \-\^\-invert\-match
+option, only print files with at least
+.I NUM
+non-matching lines.
+.TP
 .BR \-o ", " \-\^\-only\-matching
 Print only the matched (non-empty) parts of a matching line,
 with each such part on a separate output line.
diff -ur grep.pristine/doc/grep.texi grep.patched.2/doc/grep.texi
--- grep.pristine/doc/grep.texi	2008-02-07 03:43:27.000000000 +0000
+++ grep.patched.2/doc/grep.texi	2008-08-12 20:18:37.603133269 +0100
@@ -367,6 +367,15 @@
 When the @samp{-v} or @samp{--invert-match} option is also used,
 @command{grep} stops after outputting @var{num} non-matching lines.
 
+@item --min-count=@var{num}
+@itemx --min-count=@var{num}
+@opindex --min-count
+@cindex min-count
+When printing a count of matching lines for each input file (@samp{-c},
+@samp{--count} option), only print files with at least @var{num} matching lines.
+With the @samp{-v}, @samp{--invert-match} option, only print files with at least
+@var{num} non-matching lines.
+
 @item -o
 @itemx --only-matching
 @opindex -o
diff -ur grep.pristine/src/grep.c grep.patched.2/src/grep.c
--- grep.pristine/src/grep.c	2008-02-14 04:03:39.000000000 +0000
+++ grep.patched.2/src/grep.c	2008-08-12 20:24:26.349133254 +0100
@@ -284,7 +284,8 @@
   EXCLUDE_FROM_OPTION,
   LINE_BUFFERED_OPTION,
   LABEL_OPTION,
-  EXCLUDE_DIRECTORY_OPTION
+  EXCLUDE_DIRECTORY_OPTION,
+  COUNT_MINIMUM_OPTION
 };
 
 /* Long options equivalences. */
@@ -305,6 +306,7 @@
   {"color", optional_argument, NULL, COLOR_OPTION},
   {"colour", optional_argument, NULL, COLOR_OPTION},
   {"count", no_argument, NULL, 'c'},
+  {"min-count", required_argument, NULL, COUNT_MINIMUM_OPTION},
   {"devices", required_argument, NULL, 'D'},
   {"directories", required_argument, NULL, 'd'},
   {"exclude", required_argument, NULL, EXCLUDE_OPTION},
@@ -629,6 +631,7 @@
 static int out_before;		/* Lines of leading context. */
 static int out_after;		/* Lines of trailing context. */
 static int count_matches;	/* Count matching lines.  */
+static off_t min_count_matches;	/* Count matching lines.  */
 static int list_files;		/* List matching files.  */
 static int no_filenames;	/* Suppress file names.  */
 static off_t max_count;		/* Stop after outputting this many
@@ -1292,7 +1295,7 @@
     status = count + 2;
   else
     {
-      if (count_matches)
+      if (count_matches && (count >= min_count_matches))
 	{
 	  if (out_file)
 	    {
@@ -1452,6 +1455,7 @@
 \n\
 Output control:\n\
   -m, --max-count=NUM       stop after NUM matches\n\
+      --min-count=NUM       don't print files with less than NUM matches (with -c)\n\
   -b, --byte-offset         print the byte offset with output lines\n\
   -n, --line-number         print line number with output lines\n\
       --line-buffered       flush output on every line\n\
@@ -1836,6 +1840,7 @@
   filename_mask = ~0;
 
   max_count = TYPE_MAXIMUM (off_t);
+  min_count_matches = 0;
 
   /* The value -1 means to use DEFAULT_CONTEXT. */
   out_after = out_before = -1;
@@ -1946,6 +1951,26 @@
 	count_matches = 1;
 	break;
 
+      case COUNT_MINIMUM_OPTION:
+	{
+	  uintmax_t value;
+	  switch (xstrtoumax (optarg, 0, 10, &value, ""))
+	    {
+	    case LONGINT_OK:
+	      min_count_matches = value;
+	      if (0 <= min_count_matches && min_count_matches == value)
+		break;
+	      /* Fall through.  */
+	    case LONGINT_OVERFLOW:
+	      min_count_matches = TYPE_MAXIMUM (off_t);
+	      break;
+
+	    default:
+	      error (2, 0, _("invalid min count"));
+	    }
+	}
+	break;
+
       case 'd':
 	if (strcmp (optarg, "read") == 0)
 	  directories = READ_DIRECTORIES;
