command-line utility to record from microphone

I am looking for command-line utility that monitors the microphone, and if you start to speak, writes the file. Recording period should be adjusted.

Solution is:

   sox -t alsa default recording.wav silence 1 0.1 5% 1 1.0 5%

From http://dabase.com/u/record_wav/

arecord -vv -fdat stackoverflow.wav