Home arrow Shell Programming arrow Remove Duplicate Lines From a File
Remove Duplicate Lines From a File PDF
Saturday, 23 January 2010
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).

Last Updated ( Saturday, 23 January 2010 )
 
Next >

Other BSD Systems

OpenBSD

Misc

Solaris

Polls

Best BSD firewall?