https://mikebeach.org/2011/07/26/how-to-monitor-your-microphone-through-headphones-in-ubuntu/
This walks you through routing the microphone's audio to your headphones. I've tested it on a Raspberry PI (Raspbian Jessie).
pulseaudio -D
pactl list sources short
Then copy the appropriate source device to your clipboard. In my case: alsa_input.usb-0d8c_C-Media_USB_Headphone_Set-00-Set.analog-mono
pactl list sinks short
In my case: alsa_output.usb-0d8c_C-Media_USB_Headphone_Set-00-Set.analog-stereo
Edit the names of input and output to the appropriate source and sink and run the command:
pacat -r --latency-msec=1 -d alsa_input.usb-0d8c_C-Media_USB_Headphone_Set-00-Set.analog-mono | pacat -p --latency-msec=1 -d alsa_output.usb-0d8c_C-Media_USB_Headphone_Set-00-Set.analog-stereo
Whatever you say or record through your mic jack will now be output to your headphones. Enjoy!
@ericbolo Thanks for the oneliner it worked out really well without any setup or tweaking. I used it to play electric guitar plugged in as input and used headphones to hear what I am playing on my electric guitar. Thanks a ton again. I tried it on archlinux with pipewire.