sed Archive

Removing duplicate lines with sed

Posted March 15, 2012 By Landis V

# delete duplicate, consecutive lines from a file emulates “uniq”. # First line in a set of duplicate lines is kept, rest are deleted. sed ‘$!N; /^\.\\n\1$/!P; D’

via Removing duplicate lines with sed.

Be the first to comment