How do I edit files (ok don't laugh!)?

Discussion in 'Modding and Customization' started by ste5442, Nov 18, 2008.

  1. ste5442

    ste5442

    Joined:
    Nov 11, 2008
    Messages:
    3
    Likes Received:
    0
    Hi All,

    As a linux newbie I have a simple problem - how do I edit/modify files such as xfdesktopnew?
    I just need to open up the file to view the contents, make a small change and then resave it!
    In Windows the equivalent would be to open file manager and simply double click (or right click and open with) the file, edit it and save.

    Any help appreciated :oops:

    S.
     
    ste5442, Nov 18, 2008
    #1
  2. ste5442

    markh

    Joined:
    Oct 6, 2008
    Messages:
    299
    Likes Received:
    0
    Hi, the best program pre-loaded on the one for simple text files is mousepad. If you find the file in the directory system, right click ought to give you an option to edit with mousepad for most files.
    However, many files (and that sounds like one of them) need to be edited with "root" access. If so, the easiest thing to do is to open a terminal (alt-f2, type terminal, return) and type sudo mousepad then the full path and filename (example: sudo mousepad /usr/share/file.ext). That will launch mousepad for you with root access. If it doesn't need root access, then don't type sudo.

    Hope that helps, Mark

    P.S. the directories and filenames are case-sensitive
     
    markh, Nov 18, 2008
    #2
  3. ste5442

    ste5442

    Joined:
    Nov 11, 2008
    Messages:
    3
    Likes Received:
    0
    Thanks Mark - I figured out the right click > mouspad but never tried it with the terminal until you mentioned it!
    In order to edit some of the files I had to chmod them (to 777 for ease), edit with mousepad and then chmod back to original values - a very long-winded approach which the 'sudo mouspad' sorts out.
    I now know how to do two things with this OS now ;)

    Thanks!

    S
     
    ste5442, Dec 2, 2008
    #3
  4. ste5442

    the100thmonkey

    Joined:
    Oct 17, 2008
    Messages:
    42
    Likes Received:
    0
    Location:
    Edinburgh
    Something which works with Ubuntu/GNOME on the One, and I guess might work with XFCE/Linpus is to open a terminal and type "sudo Thunar" (or "sudo thunar", given that Linux is case sensitive, and I don't know which it is).

    This will open Thunar, the XFCE file management program, with root access. You should then be able to double-click on any file to edit it. You need to be very careful with this, though, as it's then very easy to delete critical system files...

    On second thoughts, don't do it... it's too dangerous. I shouldn't do it either.

    By the way, it's actually very useful to understand how to use the chmod command, so while it might be unwieldy for the job you used it for, it will help you later on.
     
    the100thmonkey, Dec 2, 2008
    #4
  5. ste5442

    ebandit

    Joined:
    Dec 28, 2008
    Messages:
    6
    Likes Received:
    0
    sudo thunar works very well in Linpus
     
    ebandit, Jan 3, 2009
    #5
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.