Results 1 to 5 of 5

Thread: How to write on a file?

  1. #1
    Join Date
    Mar 2014
    Beans
    14

    How to write on a file?

    Hi,
    I have troubles to write on my file /etc/lightdm/lightdm.conf
    I typed sudo nano /etc/lightdm/lightdm.conf to open my file but I can only read (and not write).

    This didn't work
    http://ubuntuforums.org/showthread.php?t=2141347

    but it's true, I am in recovery mode
    Last edited by Elfy; March 20th, 2014 at 09:43 AM.

  2. #2
    Join Date
    May 2007
    Location
    The New Forest
    Beans
    Hidden!
    Distro
    Xubuntu

    Re: How to write on a file?

    If you've only got read access then I'd say you've not mounted it properly to enable write.

    mount -o rw,remount /

    IF you still have issues - run one of the other commands in the recovery menu - grub update for instance, then try the root terminal again

  3. #3
    Join Date
    Mar 2014
    Location
    Netherlands
    Beans
    Hidden!
    Distro
    Ubuntu 13.10 Saucy Salamander

    Re: How to write on a file?

    Run the following script, it will open the requested file as root so you can edit it.
    gedit-su.sh
    Make sure that you allow the file to run in a terminal.

    Try also advice given above.
    Last edited by Korkel; March 20th, 2014 at 09:54 AM. Reason: Added information.

  4. #4
    Join Date
    Jul 2005
    Location
    I think I'm here! Maybe?
    Beans
    Hidden!
    Distro
    Xubuntu 22.04 Jammy Jellyfish

    Re: How to write on a file?

    Recovery mode by default mounts the filesystem now as read only (to save potentially damaging activity by users who don't know what they're doing, I think), so to make any changes to the system files you need to run that command mentioned by Elfy.

  5. #5
    Join Date
    May 2007
    Location
    The New Forest
    Beans
    Hidden!
    Distro
    Xubuntu

    Re: How to write on a file?

    Quote Originally Posted by Korkel View Post
    Run the following script, it will open the requested file as root so you can edit it.
    gedit-su.sh
    Make sure that you allow the file to run in a terminal.

    Try also advice given above.
    How does a script that includes running gedit help?

    In addition the thread has no prefix - what about if they are using Xubuntu, Lubuntu, Kubuntu ?

    Please stay on topic for the thread - which is running nano in recovery mode - there would be no need for sudo anyway once the filesystem is mounted.

Bookmarks

Posting Permissions

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