The following works very nicely to determine the length of various audio/video files:
mplayer -identify file.ogg 2>/dev/null | grep ID_LENGTH
There's another FF-way in addition to @codelogic's method, which doesn't exit with an error:
ffprobe
and look for the duration entry.
Or grep for it directly in the error stream:
ffprobe 2> >(grep Duration)