Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Possible Duplicates:
How to append to a file as sudo?
sudo unable to write to /etc/profile

The following command does not work because the elevated privileges do not apply to the redirection.

sudo echo "myoutput" >> /etc/file_that_only_root_can_write

how can it be done?

share|improve this question
1  
superuser.com/questions/54814/… –  akira Jun 23 '10 at 11:36
    
@akira you're probably right... I just started a new one because I didn't find those. –  João Portela Jun 23 '10 at 14:34
add comment

marked as duplicate by akira, quack quixote Jun 23 '10 at 19:14

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

up vote 6 down vote accepted
echo "myoutput" | sudo tee -a /etc/file_that_only_root_can_write
share|improve this answer
    
that it! thanks. –  João Portela Jun 23 '10 at 14:33
add comment

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