How to use curl command with proxy username/password on Linux/ Unix

Posted on in Categories , , , , last updated December 26, 2017

My sysadmin provided me the following proxy details:
       Port: 3128
       Username: foo
       Password: bar

The settings worked perfectly with Google Chrome and Firefox browser. How do I use it with the curl command? How do I tell the curl command to use my proxy settings from Google Chrome browser?