📜  bash 列出列中的前十个最大值 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:51:05.991000             🧑  作者: Mango

代码示例1
# 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