FedoraForum.org - Fedora Support Forums and Community
Results 1 to 11 of 11
  1. #1
    micxuy Guest

    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.

  2. #2
    Wayne Guest
    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

  3. #3
    micxuy Guest
    nice thanks...

    but i do not get your sentence:
    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

  4. #4
    Wayne Guest
    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

  5. #5
    Join Date
    Apr 2005
    Location
    Pueblo,Colorado
    Posts
    724
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  6. #6
    pdb Guest
    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

  7. #7
    Join Date
    Feb 2005
    Location
    Lansing, Mi
    Age
    42
    Posts
    2,221
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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

  8. #8
    Join Date
    Nov 2006
    Location
    Ontario, Canada
    Age
    72
    Posts
    67
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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

  9. #9
    Join Date
    May 2004
    Location
    Central Wyoming
    Posts
    657
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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!
    Registered Linux user #227845
    But, with the demise of the Linux Counter Project - who can tell...

  10. #10
    Join Date
    Feb 2005
    Location
    Lansing, Mi
    Age
    42
    Posts
    2,221
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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

  11. #11
    micxuy Guest
    very sweet,thanks a lot guys

Similar Threads

  1. How to edit ISO files?
    By Duli in forum Using Fedora
    Replies: 9
    Last Post: 10th January 2007, 01:06 AM
  2. applic that can edit pdf files?
    By oystercatcher in forum Using Fedora
    Replies: 4
    Last Post: 7th February 2006, 05:55 AM
  3. How do I log in as root and edit xorg file?
    By braveerudite in forum Security and Privacy
    Replies: 21
    Last Post: 1st July 2005, 01:06 AM
  4. How do I edit files in the terminal?
    By edkilp in forum Using Fedora
    Replies: 11
    Last Post: 15th July 2004, 04:20 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •