dd if=/dev/zero of=location+filename size=blocksize count=number of blocks desired
simple yes but has some uses

. like if you want to install linux in one partition without setting up logical partitions if say a oem installation on a laptop can wipe out recovery partition which is usually big enough for linux, use the above and
mkswap -filelocation/name-
or you can make your own vaults/encrypted volumes by formating the file like
mkfs.ext4 -filename/location-
mount -o -t ext4 -file location/name- -mount dir-
can use gpg or whatever you prefer to encrypt said file, can do multiple times over if you want. could use the same ddfile/image for anything that needs a partition or where a partition could add security like having all your web content for a web server in said partition and only give the webserver privileges to that image. it will also indicate the speed of your hdd/sdd/ram wherever your writing the file as if=/dev/zero has dd actually write all the bytes to 0