shell随机抽样实现
[dig@hadoop01 ~]$ shuf -n5 nohup.out
2017-10-18t12:42:46.027 0800 app_data.enterprise_data_gov 711103
2017-10-18t13:37:22.027 0800 app_data.enterprise_data_gov 1616844
2017-10-18t12:43:46.027 0800 app_data.enterprise_data_gov 723722
2017-10-18t14:26:31.027 0800 app_data.enterprise_data_gov 2567132
2017-10-18t12:39:49.027 0800 app_data.enterprise_data_gov 657521
随机抽取5行
参数说明:
-n d 抽取行数为d
-r 可重复