This will record the capture channel of your soundcard, directly encoded in Ogg Vorbis, in stereo at quality 5 (I'm using this to record live jam sessions from my line input). You can choose which device to capture (eg. line input, microphone or PCM output) with

alsamixer -V capture

You can do the same thing and live encode in MP3 or FLAC if you wish, just check FLAC and LAME man pages.