I tried to
cat /dev/zero, and it didn't seem to do anything. I googled
/dev/zero, and it says it's basically a blank file with infinite size. Is
cat printing an infinite number of non-existent characters? How does this work? How does it provide infinite data if it's 0 bytes? What are the uses of this file, if one can simply create a blank file?
I tried to
/dev/zero is a special file (in this case, a pseudo-device) that provides an endless stream of null characters (so hex 0x00)? That's why your
cat is not outputting anything (but try running it through
od (octal dump)).
'blank file with infinite size' is not 100% correct: it's not a regular file, but a special file (more like a 'stream' or a generator). You can read as much from it as you want, for example with
dd if=/dev/zero of=yourfile count=1024 bs=1024).
It's not really a blank file, nor used to create blank files: it's used to create files or memory pages filled with only zeroes. You can also write to it, making it perform like a sinkhole (its more popular brother
/dev/null is more commonly used for this though).