uniq command is used to remove all the repeated lines/words present in a file.
uniq <option> <filename>
uniq command is often used with the sort command because it compares adjacent characters.
sort command sorts the file content in a specific order either ascending or descending order.
sort -r <file name>
If a file has more than one column, a column number is used to sort a specific column.
sort -k<columnNumber> <fileName>
sort -nr <file name>
If you don't want to sort in reverse order, remove the option r and execute the command.
sort -c <filename>
sort -u <filename>
To know the version of the sort command give the below command,