Record Audio Files in the Command Line
From Lucca's Wiki
ffmpeg -f pulse -i default -codec:a flac filename.flac
This records files in the lossless compressed flac format. You can make an bash function like this:
recordto () { ffmpeg -f pulse -i default -codec:a flac "${1}.flac" }
and use the command like this:
recordto myaudiofile
and it will start recording to myaudiofile.flac