I find it
odd that only
one writeup shows an
actual use for /dev/null.
Okay, so here's one. Let's say a configure script wants to probe for pthread support:
echo "#include <pthread.h>\n\nint main() { return pthread_create( NULL, NULL, NULL, NULL ); }\n" > test.c
cc test.c ${LIBS} -o test 2>/dev/null
The script makes a simple pthread program and compiles it, redirecting its error stream to /dev/null. That way the user does not see compile errors. The script then checks the return code of the C compiler. If it's zero, it compiled and there is pthread support. Otherwise, there was a compile error thus there is no support for POSIX threads, and the script can give a verbose error message.
Well, that's one usage for /dev/null.