bash list the top ten largest values in a column code example
Example: bash list the top ten largest values in a column
# Example usage:
sort -k3n,3 input_file | tail -10
# Here we sort the input_file in numerical order based on the third
# field and then pipe to tail to print the last ten rows.
# If you only want to return specific fields from the sorted file, pipe
# to cut. E.g. to return the largest values from the third field:
sort -k3n,3 input_file | tail -10 | cut -f 3