 |
 |
 |
 |
| Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum. |

14th November 2006, 10:47 PM
|
|
Registered User
|
|
Join Date: Nov 2006
Posts: 36

|
|
|
How to edit root files...
Hi guys;
I am kinda new to Linux as well as Fedora.
I am trying to get used to it. However have one thing i do not get it, I am the only one using Fedora on my computer. So I have the root access.. I have seen some files with root access, I tried to edit it but it did not allow me to edit the file. I know how to log in as root -terminal-su ... but in the terminal how can i edit files, such as .PHP , .HTML etc... So now I only know one way to edit file is #chown username /dir/file.name then i can edit it.
So my question is how do i can edit the root files?
Thanks a lot. Hope you guys can help me out.
Regards.
|

14th November 2006, 10:57 PM
|
|
Guest
|
|
Posts: n/a

|
|
Quote:
|
Originally Posted by micxuy
Hi guys;
I am kinda new to Linux as well as Fedora.
I am trying to get used to it. However have one thing i do not get it, I am the only one using Fedora on my computer. So I have the root access.. I have seen some files with root access, I tried to edit it but it did not allow me to edit the file. I know how to log in as root -terminal-su ... but in the terminal how can i edit files, such as .PHP , .HTML etc... So now I only know one way to edit file is #chown username /dir/file.name then i can edit it.
So my question is how do i can edit the root files?
Thanks a lot. Hope you guys can help me out.
Regards.
|
I usually just open a Terminal, su to root and type:
gedit
Then open and edit the file. Of course, you can use vi or any other text based editor but why torture yourself
Wayne
|

14th November 2006, 11:02 PM
|
|
Registered User
|
|
Join Date: Nov 2006
Posts: 36

|
|
nice thanks...
but i do not get your sentence:
Quote:
|
Then open and edit the file. Of course, you can use vi or any other text based editor but why torture yourself
|
are there other ways or what do you mean?
Thanks for your reply
Regards
|

14th November 2006, 11:07 PM
|
|
Guest
|
|
Posts: n/a

|
|
Quote:
|
Originally Posted by micxuy
nice thanks...
but i do not get your sentence:
are there other ways or what do you mean?
Thanks for your reply
Regards
|
Sorry, what's confusing? GEdit is the GUI file editor in Gnome. From the menu select File > Open, select the file you want to edit, edit the file and save it. You can start GEdit from the Gnome menu, from a Terminal as user or as root.
There is at least one text mode (non-gui) text editor, usually vi, included in the install. It requires you to remember arcane keystrokes to open files and save them as there is no menu. As I said, if you like to torture yourself you can use it.
Type: vi filename (where 'filename' is the file you want to edit)
Wayne
|

14th November 2006, 11:36 PM
|
|
Registered User
|
|
Join Date: Apr 2005
Location: Pueblo,Colorado
Posts: 724

|
|
|
as root open the file with
nano -w /path to file
use the arrows to scroll up/down to the line you want to edit. then the left/right arrows to move the cursor to the word(s) you want to change. At the bottom of the screen is a list of commands
^G Get Help ^O WriteOut ^R Read File ^Y Prev Page ^K Cut Text ^C Cur Pos
^X Exit ^J Justify ^W Where Is ^V Next Page ^U UnCut Text^T To Spell
the caret pointing up means to hit the control key at the same time you hit the letter key. (Anyway, I THINK it's called a caret).
Really easy to use and learn. Much easier to learn than vi or vim. Works in text only mode, too.
hth
Bill
__________________
Registered Linux User : 361761 Registered Machine (2nd time): 332471
Work is for people who don't know how to fish.......;)
Sometimes the obvious is so well hidden that it boggles the mind.
|

14th November 2006, 11:39 PM
|
|
Registered User
|
|
Join Date: May 2004
Posts: 269

|
|
I recommend learning to use vi to edit files. This is a text editor for the command line. I recommend it because it is found on nearly every Linux system, so knowing how to use it is great when you get on a system without a GUI or an embedded system that doesn't have any other editor.
For an introduction to vi, see http://docs.freebsd.org/44doc/usd/12.vi/paper.html
|

15th November 2006, 12:02 AM
|
 |
Registered User
|
|
Join Date: Feb 2005
Location: Lansing, Mi
Age: 28
Posts: 2,222

|
|
Quote:
|
Originally Posted by pdb
I recommend learning to use vi to edit files. This is a text editor for the command line. I recommend it because it is found on nearly every Linux system, so knowing how to use it is great when you get on a system without a GUI or an embedded system that doesn't have any other editor.
For an introduction to vi, see http://docs.freebsd.org/44doc/usd/12.vi/paper.html
|
I agree i actually like using it, especially for small changes it has become second nature. but nano and pico do the job just as well and you are just as likely to find one of the two on the system. Gedit is great for gui. Emacs sucks.
how does the ole saying go, emacs is a great operating system, with a horrible text editor
|

15th November 2006, 02:19 AM
|
|
Registered User
|
|
Join Date: Nov 2006
Location: Ontario, Canada
Age: 58
Posts: 67

|
|
|
I like emacs, but my problem is that I don't like elisp. So I use vim these days. I recommend people interested in vim but who find it a bit daunting to try cream, which is a gvim on training wheels.
__________________
noobus in perpetuum
|

15th November 2006, 02:26 AM
|
 |
Registered User
|
|
Join Date: May 2004
Location: Central Wyoming
Posts: 637

|
|
Hey micxuy,
Welcome to one of the lesser known dark sides of the Linux community.
Editor wars. Only one of lesser known religious battle ground of the initiate.
You'll find similar strong emotions and opinions when dealing with KDE vs Gnome, various window managers, productivity suites, distributions or any of dozens of subject areas where there exist multiple options.
Biggest point for you to remember is: use what you're comfortable with. Part of the attraction to FOSS is freedom of choice. You get to use what you choose to use. Doesn't mean your choice is the most perfect, technically superior, what's packed in the box or whatever - it *is* yours. That's the most important part and the only one that really counts in the long run. As your experience continues with *nix, chances are you'll experiment with several options and maybe even change your choice. Up to you.
Now - as to why you couldn't edit those files. Read up on linux file permissions. This is one of many articles out there on the subject:
http://www.freeos.com/articles/3127/
Once you've got a handle on file permissions, likely you'll be able to solve your problem yourself. And you can use vi, gedit, nano, emacs or any of a couple dozen other editors out there. Anyone ever tries to tell you that you 'must' use one editor over another, you'll know they've wandered off into their own world. No need to follow 'em. Unless you want to.
Good luck!
|

15th November 2006, 03:38 AM
|
 |
Registered User
|
|
Join Date: Feb 2005
Location: Lansing, Mi
Age: 28
Posts: 2,222

|
|
|
oh come on zotter whats more fun then an editor debate.. personally i like them better then the gnome kde ones, guess b/c they actually affect me more, put me in front of a computer with pretty much any de on it and ill be fine as long as i can fire up a terminal. but put me on a computer with just emacs, and im sure that Escape Meta Alt Ctrl Shift would save my project launch a webrowser and telnet some host in nigeria, but i only have 5 fingers and already have an os.
ok im done now. just havent got to say something like that in a while
|

15th November 2006, 07:14 AM
|
|
Registered User
|
|
Join Date: Nov 2006
Posts: 36

|
|
|
very sweet,thanks a lot guys
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Current GMT-time: 04:06 (Monday, 20-05-2013)
|
|
 |
 |
 |
 |
|
|