Tuesday, 19 May 2015

Running pipe commands as super user in bash

sudo sh - c '[command]'

sh -c is needed here to execute that command in a root subshell. This is because sudo echo out > direction would execute echo as root, but the redirection (> direction) would be done by your current (non-root) shell. You could also just do this su root.

 source: https://groups.google.com/forum/#!topic/beagleboard/KanwoGOy2bY

No comments:

Post a Comment