Bandit Labs Writeup 8
Sorting a file.
sort prints a sorted output to stdout. You can pass from stdin or, like last time, just call it first with the file name.
uniq will merge duplicate lines toghether. By itself it prints each uniqe line to stdout. You can pass -c to get a count or the number of times it has combined a line, or -u to only print lines that were not merged. -d only prints duplicate lines. There are other options as well. Note that it does not search the entire file for duplicate only a lines immediate neighbors which is why you need to sort the file first.