sudo in terminal

Ian P. Thomas ipt at scraemon.org
Tue Feb 22 22:32:55 UTC 2005


On Tue, 2005-02-22 at 14:13 -0500, H. Crissman wrote:
> When I "vi example.file" the text inside the file is color coded based 
> on format (ie. commented out lines are blue). But when I "sudo vi 
> example.file" that color coding is lost. How can I enable that when I 
> edit a file using sudo? It really helps when you are looking at a long 
> config file.
> 
> Thanks,
> 
> H. Crissman

This will do what you want, which is to keep your environment the same,
but have root's privileges.

su root -m -c 'command you want to run between the single quotes'

The downside is that you need to type in root's password, rather then
your own.


Ian




More information about the users mailing list