Common Command line Snippets

plus2047 于 2023-01-01 发布
# random sample some lines
cat input.txt | awk 'BEGIN {srand()} !/^$/ { if (rand() <= .01) print $0}' > sample.txt