Answers for "bash list the top ten largest values in a column"

1

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
Posted by: Guest on September-10-2020

Code answers related to "bash list the top ten largest values in a column"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language