Fedora Linux Support Community & Resources Center
  #1  
Old 14th November 2006, 10:47 PM
micxuy Offline
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.
Reply With Quote
  #2  
Old 14th November 2006, 10:57 PM
Wayne
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
Reply With Quote
  #3  
Old 14th November 2006, 11:02 PM
micxuy Offline
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
Reply With Quote
  #4  
Old 14th November 2006, 11:07 PM
Wayne
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
Reply With Quote
  #5  
Old 14th November 2006, 11:36 PM
b_martinez Offline
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.
Reply With Quote
  #6  
Old 14th November 2006, 11:39 PM
pdb Offline
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
__________________
http://pdb.homelinux.net
Registered Linux User # 348314
Reply With Quote
  #7  
Old 15th November 2006, 12:02 AM
nick.stumpos Offline
Registered User
 
Join Date: Feb 2005
Location: Lansing, Mi
Age: 29
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
__________________
As always
Love, Life, Loyalty, Wisdom, Knowledge, And Understanding
FC6: Common Questions answered
Reply With Quote
  #8  
Old 15th November 2006, 02:19 AM
ejket Offline
Registered User
 
Join Date: Nov 2006
Location: Ontario, Canada
Age: 59
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
Reply With Quote
  #9  
Old 15th November 2006, 02:26 AM
Zotter Offline
Registered User
 
Join Date: May 2004
Location: Central Wyoming
Posts: 640
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!
__________________
If it ain't broken - you're not really trying....
Registered Linux user #227845
Reply With Quote
  #10  
Old 15th November 2006, 03:38 AM
nick.stumpos Offline
Registered User
 
Join Date: Feb 2005
Location: Lansing, Mi
Age: 29
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
__________________
As always
Love, Life, Loyalty, Wisdom, Knowledge, And Understanding
FC6: Common Questions answered
Reply With Quote
  #11  
Old 15th November 2006, 07:14 AM
micxuy Offline
Registered User
 
Join Date: Nov 2006
Posts: 36
very sweet,thanks a lot guys
Reply With Quote
Reply

Tags
edit, files, root

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Edit files without logging in dhblewis Using Fedora 2 6th March 2009 12:41 AM
How to edit ISO files? Duli Using Fedora 9 10th January 2007 12:06 AM
applic that can edit pdf files? oystercatcher Using Fedora 4 7th February 2006 04:55 AM
How do I log in as root and edit xorg file? braveerudite Security and Privacy 21 1st July 2005 01:06 AM
How do I edit files in the terminal? edkilp Using Fedora 11 15th July 2004 04:20 AM


Current GMT-time: 19:01 (Thursday, 24-04-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat