Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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 ran a command to download something with curl and it threw a permission denied error. So I did sudo curl and I got the same error... Why is that?

I was able to run the install command without curl, but I needed to sudo, so why does curl not work with sudo?

share|improve this question
Can you show the full command ? – Ofiris Feb 13 '13 at 5:28
Are you sure the website was not returning the "permission denied" error, rather then Perl ? What variant of Linux are you using and is SELinux running ? – davidgo Feb 13 '13 at 5:44
@davidgo I'm using OS X for this... – GiH Feb 13 '13 at 15:44
@Ofiris sudo curl | sh – GiH Feb 13 '13 at 15:45
@GiH Try adding a sudo after the pipe – Ofiris Feb 13 '13 at 17:03
up vote 3 down vote accepted

Use sudo after the pipe:

curl | sudo sh

the get script involves some installation, requires sudo to run.

share|improve this answer
Not working on OS X 10.10.3. – Ain Apr 16 '15 at 17:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .