Interview Prep/Linux/Filesystem Hierarchy, Inodes & Links

What are the special device files /dev/null, /dev/zero and /dev/urandom?

IntermediateConceptFilesystem Hierarchy, Inodes & Links
Answer
  • /dev/null discards writes and returns EOF on read.
  • /dev/zero returns endless zero bytes (used to create files: dd if=/dev/zero of=f bs=1M count=100).
  • /dev/urandom returns cryptographically secure random bytes and does not block once the pool is initialized.
cmd > /dev/null 2>&1
head -c 32 /dev/urandom | base64
All Linux questions Roadmap: Linux

More on Filesystem Hierarchy, Inodes & Links