Help - Search - Members - Calendar
Full Version: File Access
Linuxhelp > Support > Technical Support
NewLinuxUserfromWindows
Redhat Linux 8.0

specifically I'd like to edit my file:/boot/grub/grub.conf which needs root access. I'd like to open it and save it with modifications.
cagey cretin
I just learned about this editor (for the 4th time biggrin.gif). The VI editor will open up your file:
CODE
vi :/boot/grub/grub.conf (to open the file)
(lowercase letter) a (to set up to edit)
Perform your editing with the keyboard
(the escape key) esc (to stop editing)
To leave the file:
:q! (to leave without saving edit)
:wq (to save the file and exit)


You can check out commands for VI editor here:
http://www.cs.colostate.edu/helpdocs/vi.html

CC
ctrunk514
If you have Pine installed, then PICO is a really cool, easy to use text editor. Nano is another easy to use text editor.

I never like VI, always thought it was a pain to use, thats just me though.
NewLinuxUserfromWindows
http://phuckfonix.antiskewl.com/snapshot1.png is what I get with VI; how can I correct this?

I'll consider Pine's PICO
cagey cretin
If you [D] delete it, you will be able to write your 'new' one. I did that today several times with *.conf files and it was fine.

Remember, I am a noob. Don't take my workd, someone else will say yay or nay.

CC biggrin.gif
hughesjr
That means that you either have the file open in another window ... (probably not) ... OR you didn't exit the file properly the last time you had it open in vi ... (that's probably the problem).

You can Delete the file (you are deleting the swp file)...

Make sure you exit vi when you are finished editing ...first you have to get to the command line ...here is a full proff way..

1. press the Esc key
2. press the : key ... you should see the cursor move to the bottom of the screen and see a : followed by the cursor.
3. use q! followed by enter if you don't want to save changes... or wq! if you do want to save changes.

after you are back at the command prompt, you can close the terminal window...
NewLinuxUserfromWindows
http://phuckfonix.antiskewl.com/snapshot2.png is what I get now

I need to append: (after skipping a line)
CODE
title Windows 98
   rootnoverify (hd0,0)
   chainloader +1

Note that this is a file that needs root access. I don't know how to open it with an editor using root access.

I hope .png is working for everyone. Most if not all Linux users should. Sorry most IE browsers for missing out on a very cool format? I'm Mozilling myself.
hughesjr
probably the easiest way is to open a terminal window (logged in as your normal user) then use the command:

su - root

(and type your password when asked)

now that window (but not the rest of your system) is root ...

inside the root window, type gedit if you use gnome ... or kate if you use KDE. The editor that opens is running as root. Browse to the file you want to open and edit it.

You can also use vi (or any other console editor) from within the root window as root.

-------
If you accidentially erased your grub.conf file and not the /var/tmp/grub.conf.swp file, post a file listing of your /boot directory (output of ls -al /boot) and post your mounted drives (output of mount) and I'll biuld you another grub.conf.
NewLinuxUserfromWindows
My grub.conf seems to be intact. I backed it up to my root directory. Logging in under root in terminal and launching that editor(kate in my case) was successful.

But I still have booting problems, http://www.linuxhelp.ca/forums/index.php?a...t=ST&f=3&t=2282 is where I started a post on booting issues I've had with GRUB.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.