Skip to content

Instantly share code, notes, and snippets.

@yalab
Last active August 31, 2021 02:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yalab/d4088f747b38419625b0ff66d49534c4 to your computer and use it in GitHub Desktop.
Save yalab/d4088f747b38419625b0ff66d49534c4 to your computer and use it in GitHub Desktop.

awk random extract line

$ awk '{ srand(); if(NR == (n = int(rand() * 124478))){print n, $0}}' FILEPATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment