Curl Set User Agent Command on Linux or Unix

Originally published at: https://www.cyberciti.biz/faq/curl-set-user-agent-command-linux-unix/

I need to set the user agent header for curl command. How can I set or change user agent with curl command on Linux or Unix like system?