|
|
|
|
|
by tbirdz
2994 days ago
|
|
The reason why sudo wasn't working is that it runs the command with root privileges, but redirecting to a file with > is done through the shell, which is running under your normal user level privileges. If you want to redirect to a file that only root can write to, you can use the tee command. That command will write anything passed to it via stdin to the file given as an arg. For example, echo "foo" | sudo tee /path/to/file or any of the other ways listed here: https://stackoverflow.com/questions/82256/how-do-i-use-sudo-... |
|