The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Can't delete a folder

Discussion in 'General Discussion' started by masterfujin, Feb 7, 2011.

  1. masterfujin

    masterfujin Registered

    Joined:
    Feb 7, 2011
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Auckland, New Zealand
    Im having problem with this folder which is named "PEAR" at the /public_html. I installed this sort of application and I'm trying to delete it because I want to install a new version, but it keeps coming back. Do you know what the problem could be?
     
  2. forum17

    forum17 Active Member

    Joined:
    Mar 30, 2007
    Messages:
    29
    Likes Received:
    0
    Trophy Points:
    0
    Hello,

    If you are not able to delete it then make sure ownership of the directory is correct. Also check the attribute set to this directory. You can check the same using command.

    lsattr it shall be ------------- . If it contains a/u/i then that could be the problem.

    Regards,
    host.co.in
     
  3. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Hello,

    To expand on what forum17 has mentioned, you could run the following in root SSH to see the ownership and file permissions for the PEAR folder:

    Code:
    ls -ld /home/user/public_html/PEAR
    Please replace user with the cPanel username. If the directory is not owned by the right user (so possibly root or nobody owns the file) or has 000 file permissions, this could well be why it isn't letting you remove it.

    Next, for the lsattr command, again put the full path for public_html to see the permissions on it:

    Code:
    lsattr /home/user/public_html
    Then check what the PEAR folder shows for that command. You might also want to drill into the folder to run lsattr on it, since anything with immutable attributes will prevent the folder from being deleted (here immutable will be an i showing up when running lsattr). You can unset the immutable bit on a file or folder by running:

    Code:
    chattr -i /home/user/public_html/PEAR
    If there are files within the directory that are immutable, you can do this recursively:

    Code:
    chattr -i -R /home/user/public_html/PEAR
    Thanks.
     
Loading...

Share This Page