linux uniq based on the first column code example
Example: bash return unique lines starting at nth field
# Basic syntax:
uniq -f number input_file
# Where number specifies the number of fields/columns to ignore from left
# to right when doing comparisons to return unique lines
# Note, uniq requires a sorted input. You can sort a file based on
# specific fields with sort -k start_field_#,end_field_#
# Example usage:
sort -k 5,7 input_file | uniq -f 5 # This would sort the file using
# fields 5-7 and then return unique lines based on a comparison
# starting at the 5th field