Find the answer to your Linux question:
Results 1 to 8 of 8
I'm Very new to linux. which means I just installed linux. How can I change the index.html file? my dir is var/www/index.html it doesnt allow me to delete it the ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2010
    Posts
    3

    How can I change the index.html file?


    I'm Very new to linux. which means I just installed linux. How can I change the index.html file?

    my dir is var/www/index.html

    it doesnt allow me to delete it the index.html (permission denied)
    I can't move a file into it either. (permission denied)

    is there no way of dragging files into the folder?

    Please Help!

  2. #2
    Linux Newbie
    Join Date
    Apr 2007
    Posts
    119
    Do you have the file permissions to do these tasks? I would check that first.

  3. #3
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Location
    Harrow, UK
    Posts
    1,237
    Linux does things differently to Windows. In Linux, the system files (that means just about everything outside your home directory) belong to the root user. That means that only root can change them. And that means they can't be changed by any malware that you pick up from the Internet - unless you have been browsing or opening emails as root, which you shouldn't be! It's what makes Linux so secure.

    You don't say what distribution of Linux you are using. Some distributions make you provide a root password at installation; in that case, you can use it to become root via the su command and then you can edit this html page. Others, like Ubuntu, give you root access via the sudo command using your own password. But you should never use the powers of root lightly. Always ask yourself first: Is this really necessary?
    "I'm just a little old lady; don't try to dazzle me with jargon!"
    www.hrussman.entadsl.com

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Jul 2010
    Posts
    3

    I really don't know anything about linux.

    Can someone give me step by step on what to do?

    I'm using ubuntu desktop and I want to be able to change the index.html file.

    is there something I have to do in the command line?
    Also I have no idea what my root password is. I only know the password for sudo...but I have no idea what su is...

  6. #5
    oz
    oz is offline
    forum.guy
    Join Date
    May 2004
    Location
    arch linux
    Posts
    18,733
    Quote Originally Posted by kooza View Post
    Can someone give me step by step on what to do?
    Hello and welcome!

    Go to a terminal and enter the following command to change the file name to whatever you want it to be:

    Code:
    sudo mv /path/to/file_name /path/to/new_file_name
    The mv command will rename (or move) the file to the new name.
    oz

  7. #6
    oz
    oz is offline
    forum.guy
    Join Date
    May 2004
    Location
    arch linux
    Posts
    18,733

    a little more info for you

    If you are interested in learning more about su vs sudo, you can read this short article to help you understand the difference:

    http://www.linuxforums.org/forum/ubu...in-ubuntu.html

    For some quick and easy lessons on using the command line under Linux, check out LinuxCommand.org:

    LinuxCommand.org: Learn the Linux command line. Write shell scripts.

    Best of luck to you... we hope you'll have fun with all of it!
    oz

  8. #7
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    the file should be owned by the apache2 user, which on ubuntu should be www-data, i would use -u in sudo command to specify that user when creating and editing files in there, that way apache has no problems

    something like this sudo -u www-data vi /var/www/index.html
    if you use graphical gksudo -u www-data gedit /var/www/index.html

  9. #8
    Just Joined!
    Join Date
    Jul 2010
    Posts
    3

    index.html (solved)

    Thanks Ozar and everyone for all your help

    I tried sudo mv /path/to/file_name /path/to/new_file_name and it worked!!!

Posting Permissions

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