
I don’t want to go into the mechanics of it, but essentially /dev/random will eventually block unless your system has a lot of activity, /dev/urandom in non-blocking.
LINUX CREATE LNK FILE GENERATOR
This is another special file in Linux, it is a partner of /dev/random which serves as a random number generator on a Linux system. This is a similar case to the above, use /dev/urandom.
LINUX CREATE LNK FILE FULL
You want a file of a particular size but don’t want it to just be full of nulls, other than that you don’t really care. When You Don’t Care About The Contents But Want Some Lines The disadvantage is the fact that the file will only contain null characters and as a result will not seem to contain any lines.

When You Don’t Care At All About The Contents Of The File
LINUX CREATE LNK FILE FREE
If you’re on Solaris feel free to investigate. Solaris has a command called mkfile which will allow you to generate a file of a particular size, but we don’t have this command on Linux ( or at the very least I don’t have it on Ubuntu), so I’ll leave it at that.

Let us examine some of the options.įirstly, to get the obvious out of the way. Since you normally don’t have files that are 1Gb or more in size just lying around, generating some is probably a good way to go.įortunately the Linux command line has all the tools we need to quickly and easily generate any kind of data file that we require ( I am of course assuming that as a self-respecting developer you’re using or at least have access to a Linux system :)). algorithm) to see how it would handle very large sets of data. Another reason might be when you need to test some functionality ( e.g. Rather than hunt around for files that would fit the bill, it was a lot easier to just generate some. For example, recently we needed to test the file upload functionality of a little application we were writing at work, using a whole range of files of different sizes ( from 100Mb). There are a number of reasons why you might want to generate a data file.

Rather than searching around for a file that fits your needs, the easiest thing to do is simply to generate one. There comes a time in every developers life where they need a data file for testing purposes and there are none handy.
