remove duplicate in a file Sep 14, 2018 • ulysses Here’s a Perl script for removing duplicates in a file. perl -ne 'print unless $dup{$_}++;' input_file > output_file