Tip-redirecting with sudo command

If 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.

Creative Commons License
linuxine.com's blog posts is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 United States License