Find the answer to your Linux question:
Results 1 to 6 of 6
I have accidentally copied many things in /root folder now i need to delete them but im not sure about which ones were already there before. I compared the last ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2012
    Posts
    54

    Question Content of /root folder


    I have accidentally copied many things in /root folder now i need to delete them but im not sure about which ones were already there before.

    I compared the last edited dates but somehow that doesnt tell me anything because they are all pretty old like at least a month old.

    So anyways, the question is;
    Do i need any of the files in /root folder? Can i delete them all? or do i have to keep some of them to get my site working properly?


    As far as i remember, that folder didnt have more than 1 or 2 files when i first migrated my site to that server. But im not positive. How about in your server? Do you have bunch of stuff in /root folder?

  2. #2
    Super Moderator Roxoff's Avatar
    Join Date
    Aug 2005
    Location
    Nottingham, England
    Posts
    3,892
    Your /root folder is your home directory for your root user. If you've written stuff to that directory, or if you've put scripts in there while you develop them, then you should perhaps save them out before you delete. But I think the answer you're looking for is that the system itself doesn't put stuff there or keep stuff there for normal operation. While you could lose files which might be valuable to you, the system itself will not care if you delete the contents of the /root directory.
    Linux user #126863 - see http://linuxcounter.net/

  3. #3
    Just Joined!
    Join Date
    Aug 2012
    Posts
    54
    Quote Originally Posted by Roxoff View Post
    Your /root folder is your home directory for your root user. If you've written stuff to that directory, or if you've put scripts in there while you develop them, then you should perhaps save them out before you delete. But I think the answer you're looking for is that the system itself doesn't put stuff there or keep stuff there for normal operation. While you could lose files which might be valuable to you, the system itself will not care if you delete the contents of the /root directory.
    Thank you very much.
    So /root folder is basically the folder which is only for root user himself?
    I understand system doesnt care about the content of /root folder but how about like modules, softwares, scripts, webmin, WP, SMF, rsync etc. which you install automatically or through ssh or something?

    I wish i can get a backup before deleting them but they are pretty big 100 something GB. So I think i will just take my chance and delete them all.

  4. #4
    Super Moderator Roxoff's Avatar
    Join Date
    Aug 2005
    Location
    Nottingham, England
    Posts
    3,892
    If you've written scripts yourself that reference files in /root, then keeping those files might be a good idea. If you're ssh-ing around as the root user, I recommend you don't do that any more, delete the root's .ssh directory and do it all as a regular user.

    If other software packages are writing settings to /root, it's because you're running as root, and this is not good practice. If you delete files from the /root directory, you may lose settings that have been saved while running packages as the root user.
    Linux user #126863 - see http://linuxcounter.net/

  5. #5
    Just Joined!
    Join Date
    Aug 2012
    Posts
    54
    Ok. Well i deleted everything there and so far its all good. Dont have any problem yet. Thank you very much for your help.

  6. #6
    oz
    oz is offline
    forum.guy
    Join Date
    May 2004
    Location
    arch linux
    Posts
    18,733
    Quote Originally Posted by Website View Post
    Ok. Well i deleted everything there and so far its all good. Dont have any problem yet.
    Hello, Website

    A good approach for the removal of files that you aren't sure can be deleted is to simply rename them or add an extension to them such as .OLD, then once you are sure no problems exist because of the change you can totally remove the renamed files. Just a safety precaution but it's always worked for me.
    oz

Posting Permissions

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