unique: Delete redundant elements from a list

Package: lists

Usage

unique files

Parameters

files
List of files to be processed.

Description

Task unique reads the input comparing adjacent lines. The second and successive copies of a line are removed; the remainder is passed on to the standard output.

Examples

Remove repeated names from a list. Note the input file has been sorted alphabetically so repeated names are adjacent.

cl> sort names | unique > names.final

See also

sort