Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to reduce the keystrokes when I use curl to test web services on my workstation.

Is there a way to set a default hostname of 'localhost:3000' into ~/.curlrc so the following will work?

curl /foo.json
share|improve this question

On Unix – shell functions:

cu() { curl "http://localhost:3000/$1"; }

cu foo.json would be translated to curl http://localhost:3000/foo.json.

Downside: needs far more code to support options (curl -I and stuff), but that can be achieved too.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.