Saturday, 11 February 2017

Use of uniq command

uniq : This command is used to displays uniq lines in the given file but the file contents must be in sorted order.
                                    Syntax:$uniq <filename>
Ex:$uniq sample

a)uniq -u <filename> : It displays non duplicate lines.
                                  Syntax: $uniq -u <filename>
Ex :$uniq -u sample

b)uniq -d <filename> : It displays duplicate lines
                                   Syntax: $uniq -d <filename>
Ex :$uniq -d sample

c)uniq -c <filename> : It counts how many times the lines are repeated in the file.
                                   Syntax: $uniq -c <filename>
Ex :$uniq -c sample

No comments:

Post a Comment