LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Distributions (https://www.linuxquestions.org/questions/linux-distributions-5/)
-   -   Simple question - how to edit config file in Suse 9.1? (https://www.linuxquestions.org/questions/linux-distributions-5/simple-question-how-to-edit-config-file-in-suse-9-1-a-206406/)

rollo 07-17-2004 07:43 PM

Simple question - how to edit config file in Suse 9.1?
 
Just trying to do a simple thing, as usual falling at the first hurdle...

I want to edit a root-privileged config file.

- Logging in as 'root' just brings up YAST, and not the desktop. What is going on? I can't use the Kate text editor to edit the files unless I am logged in as root...

- Using the 'edit' command in Konsole doesn't bring up the file specified, for some reason. What is the correct command for editing files at the command line? (I am correctly logged on as root using the 'su' command, so it's not this.)

Thanks for any advice. One day soon I will achieve my single but strangely challenging goal of getting Suse to see the internet. This is just the first, small step!

rgiggs 07-17-2004 07:53 PM

you can use emacs or pico.

emacs <path to the file> or pico <path to the file>

when you're done:

* in emacs, press control + x + s to save, then control + x + c to exit emacs.
* in pico, press control + o, then it will ask you what file to write, you can just press enter, then press control + x to exit pico.

while pico might not be installed, emacs should be by default. you can use other editors of course.

jschiwal 07-18-2004 01:18 AM

If you want to edit a file as root, you could preface the command with the 'kdesu' command.

For example, entering 'kdesu kedit' and then entering the root password when prompted will start up the kedit program as root.

The edit command in konsole will enable you to copy highlighted text for example. But since konsole isn't an editor, you need to run an editor program to edit a file.

There is another way to start a program as root. Let's say that you dragged an icon from the menu to the taskbar. Right click on the task bar icon and select properties. Click on the Application tab. Click the Advanced Options... button. Select Run as a different user, and enter the username of root. Click OK to exit.

Then when you want to edit a system configuration file, just click on the taskbar icon and enter the root password.

rollo 07-18-2004 08:47 AM

Thanks so much rgiggs and jschiwal - problem solved. (Particularly useful tip to 'run as different user'.)


All times are GMT -5. The time now is 01:57 PM.