Home arrow Shell Programming arrow Remove Duplicate Lines From a File
Remove Duplicate Lines From a File PDF  
Digg Reddit Ma.gnolia Stumble Upon Facebook Twitter Google Yahoo! MyWeb Furl" BlinkList Technorati Mixx Bookmark
To remove duplicate lines from a file (keeping a list one of those lines) use:

Remove duplicate lines from a file
  1. #!/bin/sh
  2.  
  3. awk '!x[$0]++' input.txt > output.txt

Use this line only from a script (and not from command line).

 
Next >

Other BSD Systems

OpenBSD

Polls

Best BSD firewall?