shuf -n5 main.txt sort -R main.txt | head -5 awk -vN=5 -vC=”`wc -l file`” ‘BEGIN{srand();while(n<N){i=int(rand()*C+1);if(!(i in a)){a[i]++;n++}}}NR in a’ file while read line;do echo “$line $RANDOM”;done < main.txt | sort -k2,2n| awk ‘NR<=5{print $1}’ shuf 命令的选项: -e, –echo :将每个参数视为输入行 -i, –