Wednesday, April 10, 2013

Simple and nice Linux IO hog

seq 10000 > foo; tail -n +2 foo >> foo
The above will make foo indefinitely large.

The tricky part is that this "hogging" would not happen if foo was small enough - i.e. if tail can read it in one read request. For instance, setting seq 1000 does not create problem (on my PC).