Extract and encode a cd to mp3 via the Linux cli

Ripping a cd and encoding it to mp3 is so easy it takes only 3 lines to be achieved.

mkdir cd01 && cd cd01                         # create a directory and put yourself in it
cdparanoia -B                                 # extract all the cd tracks in current directory as .wav files
for t in *.wav; do lame -b 320 $t; done       # encode all the files to mp3 320kbps

It makes it rather easy to script and encode all your cd collection easily if needed.