3 ms·
Correct. In these kinds of situations I usually do sudo sh -c 'blah blah blah >> file' but I don't like it when I have to do that.
by vive-la-liberte 11y ago
Correct. In these kinds of situations I usually do
sudo sh -c 'blah blah blah >> file'
but I don't like it when I have to do that.
- deleted 11y ago[deleted]
- laumars 11y agoA better way to write files as root is to pipe the output into `tee`. eg: blah blah blah | sudo tee -a file This will do the appending as per your example. If you want to write to the file like people are doing with the Ubuntu image then just drop the append (-a) flag: cat ubuntu-14.04-desktop-amd64.dmg | sudo tee /dev/sda1 Though obviously the `dd` utility is still a better way of writing disk images than any of the above.