3 ms·You can spawn a shell as root but this is hardly any more elegant. sudo sh -c "echo 'foo' >> /etc/file"by therein 11y agoYou can spawn a shell as root but this is hardly any more elegant. sudo sh -c "echo 'foo' >> /etc/file"