Snippet: Random sample from a file with awk

index > programming > shell > awk

awk 'BEGIN {srand()} !/^$/ { if (rand() <= .01) print $0}'