LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Editing a file as root in Debian (https://www.linuxquestions.org/questions/linux-general-1/editing-a-file-as-root-in-debian-795887/)

Cultist 03-16-2010 05:47 PM

Editing a file as root in Debian
 
I've tried and tried to figure this one out on myself, but I've failed, so I'll pose the question to LQ, and get the probably ultrasimple answer.

I'm trying to edit

/boot/grub/menu.lst

But any changes I make cannot be saved unless I'm in root. I might be doing this wrong, but I cannot log into root or figure out how to open this file as the root user. I'm still somewhat new to Linux, so could someone please give me an idiot-friendly step-by-step of what to do to open, edit, and save this file as a root user?

Assume I've just booted Debian and logged in under my username. What do I do from here?

repo 03-16-2010 05:50 PM

open a terminal, type
Code:

su
and give the root password
type
Code:

nano /boot/grub/menu.lst
make the changes and safe the file.

Quakeboy02 03-16-2010 07:34 PM

Or "sudo nano /boot/grub/menu.lst". Or "gksu gedit /boot/grub/menu.lst". etc, along that line.

chrism01 03-16-2010 08:14 PM

Use

su -

the '-' gives you root's env as well.
Incidentally, on a lot of systems, menu.lst is just a symlink; the real file is /boot/grub/grub.conf


All times are GMT -5. The time now is 06:56 PM.