Wednesday, 31 May 2017

Unix Tips and Tricks: Script to Generate Random Values

The following command will generate the random values with 100 rows. The record consists of alpha numeric character. 


  1. cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 100  

To get only the numeric value the same code can be replaced as follows. 


  1. cat /dev/urandom | tr -dc '0-9' | fold -w 32 | head -n 100  

No comments:

Post a Comment