Check out this command using ffmpeg:
for f in *.{wav,WAV}; do ffmpeg -i "$f" -c:a libmp3lame -q:a 2 "${f%.*}.mp3" -c:a libvorbis -q:a 4 "${f%.*}.ogg"; done
If you have a folder with a bunch of wav files and want to convert them to mp3 and ogg.
If you only want mp3’s you can just
for f in *.{wav,WAV}; do ffmpeg -i "$f" -c:a libmp3lame -q:a 2 "${f%.*}.mp3"; done