Cannot Delete Files / Folders In Linux

A folder/file is not getting deleted? Have changed the permission and ownership but still cannot delete?

This can be due to the immutable flag set.
(Specially In ISPConfig when a folder is created for a site or when folder is mapped to a FTP User, ISPConfig itself sets the immutable flag)

To delete a folder or file which has the immutable flag set, try the following

chattr -i filename/foldername
rm -f filename / rm -f -r foldername

A folder still is not getting deleted? Try

cd foldername
chattr -i .
chattr -i ..
cd ..
rm -f -r foldername

 

 

Leave a Reply