Pages

Saturday, February 7, 2015

Redirect output to a write-protected file with sudo but without sh -c, using tee.

$ command foo bar | sudo tee /etc/write-protected > /dev/null

Use tee -a to append.




commandlinefu.com


by David Winterbottom (codeinthehole.com)






from All commands http://ift.tt/1zv0JvI.

No comments:

Post a Comment