This question is addressed in BashFAQ/032. In your example, you would:
{ time sleep 1; } 2> /dev/null
The reason why
time sleep 1 2>/dev/null
doesn't behave how you're expecting is because with that syntax, you'll want to time the command sleep 1 2>/dev/null (yes, the command sleep 1 with stderr redirected to /dev/null). The builtin time works that way so as to make this actually possible.
The bashbuiltin can actually do this because... well, it's a builtin. Such a behavior would be impossible with the external command time usually located in /usr/bin. Indeed:
$ /usr/bin/time sleep 1 2>/dev/null
$
Now, the answer to your question
Why does the output of some linux programs go to neither STDOUT nor STDERR?
Best Answer
There are only three ways I know of to determine what a program will output to STDOUT and what to STDERR
Read the documentation. Or
Experiment with redirectionâ€
print STDERR in red
†For example:
program > program.stdout 2> program.stderr
Then look at the two output files to see what the program has written to STDOUT and what it has written to STDERR.
Instead of redirection you can pipe to
tee
if you need output to continue to the screen as well as into a file. See https://stackoverflow.com/q/692000/477035