Tip-redirecting with sudo command
Author: admin Posted in July 10, 2008If you directly use sudo command to redirect ,you will probably get error,eg:
sudo route -n> /etc/linuxine
you will get error:
bash: /etc/linuxine: Permission denied
The correct command for redirection should be:
sudo sh -c “route -n > /etc/linuxine”
Essentially you need to open a new shell as root, because it’s the shell that’s doing the redirection.
Related posts:
Tags: command, redirect, sudo
Posted in: Linux Command Tips, Linux Server Tips, Linux Tips |
Posted in: Linux Command Tips, Linux Server Tips, Linux Tips |
July 18th, 2008 at 11:34 pm
Thanks! This finally solved my puzzle of how to kill the hardware beep with one command:
sudo sh -c “echo blacklist pcspkr >> /etc/modprobe.d/blacklist”