uniq(1posix) - report or filter out repeated lines in a file
-c     Precede each output line with a count of the number of times the line occurred in the input.
-d     Suppress the writing of lines that are not repeated in the input.
-f  fields
       Ignore  the  first  fields  fields  on  each  input line when doing comparisons, where fields is a
       positive decimal integer. A field is the maximal string matched by the basic regular expression:

       [[:blank:]]*[^[:blank:]]*

If the fields option-argument specifies more fields than appear on an input line, a null string shall  be
used for comparison.
-s  chars
       Ignore  the first chars characters when doing comparisons, where chars shall be a positive decimal
       integer. If specified in conjunction with the -f option, the  first  chars  characters  after  the
       first  fields fields shall be ignored. If the chars option-argument specifies more characters than
       remain on an input line, a null string shall be used for comparison.
-u     Suppress the writing of lines that are repeated in the input.