Fix FileOp Failure: Directory not empty error with SSH in 5 minutes
Here’s an extensive guide on how to fix the fileop directory not empty error with ssh
Jan 9, 2025
By default, WordPress folders and files come with a permission setting of 755 and 644 respectively. Sometimes though, largely due to malware, these files are changed to reflect something else, which make deleting them a hassle. A file of 444 for instance can’t be deleted unless it is manually changed to 644 or above. And many times, you have literally thousands of files affected and fixing them would mean going through them one by one and changing their file permissions.
But what if I told you that there is a shorter and cleaner solution using SSH and CHMOD?
Do note that to follow this tutorial, your cPanel needs to have SSH Access. If it doesn’t, kindly speak to your host.
Now, to continue, watch this video to setup SSH on your computer:
If you already have PUTTY on your device and know how to run SSH, then navigate to the affected folder and use these two commands separately:
-
find . -type d -exec chmod 0755 {} \;
-
find . -type f -exec chmod 0644 {} \;
You might’ve guessed but what the first command mean is, find in this location any directory and change it’s file permission to 0755 and the second relates to files and changing permissions to 0644.
It is super quick and in no time, you’ll have whole directories and files cowering in fear as you delete.
To all directories and files, we say: