📌  相关文章
📜  如何找到数据集的最小值和最大值 - Shell-Bash 代码示例

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

代码示例1
#minimum
cat your_data_file.dat | sort -nk3,3 | head -1 
                            #this will find minumum of column 3
#maximun 
cat your_data_file.dat | sort -nk3,3 | tail -1
                        #this will find maximum of column 3 
#to find in column 2 , use -nk2,2 

#assing to a variable and use 
min_col=`cat your_data_file.dat | sort -nk3,3 | head -1 | awk '{print $3}'`