Tuesday, November 7, 2017

Create Numbers List .

Hello everyone,

In this post i would like to share with you a command to create a numbers list.
This command is in linux Bash and requires a ruby.
Steps :

First Step :

Open your linux shell and get the root access (not obligate).

Second Step:

Write this Ruby command ;

ruby -e 'puts 0.upto(9_99999).map { |i| "%06d" % i}.join("\n")' >  num_list.txt

where 9_999999 is the numbers range, and creates list from 000000 to 999999 > means six digits

if youwant to create 4 digits just change the 999999 to 9999.

the result will be stored in the file "num_list.txt"

i hope you will this post.

No comments:

Post a Comment