Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

When I run this command it fails:

sudo echo '/usr/local/lib' >> /etc/ 
bash: /etc/ Permission denied

I don't have any problem running sudo for other tasks. I am using Ubuntu 12.04. It works when connected as root.

Any help will be much appreciated

share|improve this question
You do a sudo echo but the remainder of that command is NOT executed as sudo (the rerouting is not done as sudo ;-) ) – Rinzwind Apr 10 '13 at 10:18
up vote 9 down vote accepted

From memory this should do it:

sudo sh -c "echo '/usr/local/lib' >> /etc/"
share|improve this answer
Could you add an explanation on why this works? – Bar Apr 1 at 12:06

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.