generating 50 gigs for DC hub | with cat and some little bash

Although half the world yells for Privacy to Personal Data our ISM DC HUB host is still configured to accept users who share above 50 Gigs.

I don’t want to yell much about the privacy here but i want to share how i generated 50 gigs of memory in a very short time.

GEN50 G #1:

my first and a foolish way to generate 50 gigs is to append some large string to the file continuously.

eightnoteight@mr:~/ a='cat txt' 
eightnoteight@mr:~/ while true; do
> echo $a >> txt
> done

GEN50 G #2:

soon i realized that this is slow and linear but i wanted to generate 50 Gigs in short time i.e a fast way. then i felt that i have to generate 50 gigs not in a linear fashion but in exponential fashion( i.e T(n) proportional to inverse of an exponential function ). so i followed this

eightnoteight@mr:~/ while true; do
> cat txt >> tmp
> cat tmp >> txt
> done

The file size increased in Fibonacci fashion (an exponential function). One interesting fact is that my T(M) is not proportional to an inverse of F(n) [where F is Fibonacci function] but proportion to a linear because i don’t have Infinite RAM 🙂

and I’m completely amazed to see how cat manages to cache and clear the memory. but i don’t get one thing that top is not showing the memory used by cat. Does that mean cat works through kernel calls ?! (I’m still on that)


Screenshot from 2014-09-20 19:47:34Screenshot from 2014-09-20 19:43:28


2 thoughts on “generating 50 gigs for DC hub | with cat and some little bash

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s