noob question about redirecting stderr

I dont know what I am doing wrong but I would like to redirect the stderr output to a file?

the specific command is this

time wget http://www.something.com/somefile.bin

All I want to see is time's output which is stderr so I can see how long the file download took. I've tried redirecting stderr to a file with "2> /some/file.txt" but it does not capture anything. I also cant redirect stderr to stdout and pipe the output to another command to get the info I want :confused:

Anyone know what I am doing wrong.. or does anyone have a better way to determine how fast a machines wan connection is to a specific server?

thanks

The problem is, 'time' is not an external command, it is a builtin, and one that doesn't seem to obey normal redirection either! I had to wrap it in brackets to get the shell to catch it.

( time wget -q sitename -O /dev/null ) 2> wlog

wget's built-in -q is easier than > /dev/null 2> /dev/null, and -O /dev/null stops it from cluttering your current directory with downloaded files.

thank you!, I may have head of hair left after I finish this script after all :slight_smile:

This was driving me nuts! and the -O option is nice.. I was palnning on rm'ing the downloaded file afterwards... now I dont have to.