i do this often, its pretty easy once youve got it figured out
Firstly: you will need an application. get "grip", its easy to use, stable and you get a good output.
Secondly: You will need a ripper. This converts CD audio to wav file. They are pretty standard and are generally included in a standard installation. Common examples are cdparanoia and cdda2wav.
Thirdly: You will need an encoder. This compresses the audio wav file into a different file extension (compression), such as ogg or mp3. For mp3 encoding, get either bladeenc or lame.
Links
bladeenc -
http://bladeenc.mp3.no/
lame -
http://lame.sourceforge.net/
Now open grip and configure the ripping and encoding options, such as output name (check the help for %'s, such as artist, name and track no.) You also need to set options such as encoding bit rate and quality.
Good luck[/b]