/dev/null is end of file when read and discards data when written. It’s convenient to redirect input for programs that otherwise expect a keyboard, and discard unwanted output like directory errors from “grep <something * 2>/dev/null”.
/dev/random and /dev/urandom are the same driver, which collects entropy (randomness) from activity on the system. /dev/random will delay until it has collected enough random bits for the request, /dev/urandom will “make up” random numbers (using a random number generator) if necessary, so it won’t block. /random provides stronger numbers for things like cryptography, the /urandom is good enough for games and similar programs.
/dev/zero discards written data, and returns just zeros. I’ve used it to rapidly (and only mildly securely) overwrite files, and a source of data to create files of fixed size.
Latest Answers