uniq-reports on duplicate lines in a file

 <  Day Day Up  >  

uniq ” reports on duplicate lines in a file

 uniq [ [ u ] [ d ] [ c ] [ +n ] [ n ] ] [ input [ output ] ] 

uniq reads the input file, comparing adjacent lines. In the normal case, the second and succeeding copies of repeated lines are removed; the remainder is written on the output file. Input and output should always be different.

Example A.67.
 1   uniq file1 file2 2   uniq -d -2 file3 

EXPLANATION

  1. Removes duplicate adjacent lines from file1 and puts output in file2 .

  2. Displays the duplicate lines where the duplicate starts at third field.

 <  Day Day Up  >  


UNIX Shells by Example
UNIX Shells by Example (4th Edition)
ISBN: 013147572X
EAN: 2147483647
Year: 2004
Pages: 454
Authors: Ellie Quigley

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net