Skip to content
Home » AIX » How to Resolve rm: 0653-609 Cannot remove

How to Resolve rm: 0653-609 Cannot remove

0653-609 Cannot remove

Tried to remove some files, but it failed with 0653-609 Cannot remove. Let's see the case.

[oracle@primary01 export]$ pwd
/backup/export
[oracle@primary01 export]$ rm ./exp_20220110.dmp
rm: 0653-609 Cannot remove ./exp_20220110.dmp.
The file access permissions do not allow the specified action.

We checked the file permission.

[oracle@primary01 export]$ ls -al ./exp_20220110.dmp
-rw-r--r--    1 oracle   oinstall          0 Jan 10 15:52 exp_20220110.dmp

It looks good, it has write permission w, beside, the file is belong to the owner oracle.

We turn to check the directory permission.

[oracle@primary01 export]$ ls -al ..
...
dr-xr-xr-x    2 oracle   oinstall        256 Jan 10 15:52 export

Obviously, the directory lacks write permission w. To clarify why we need write permission on directories to delete files, I quote some useful information from Basic AIX Permissions on the official website.

For a directory, a “w” means you can change the contents of the directory, namely creating or deleting files.

Which means, we should have write permission to remove files.

Solution

If you're the owner of this directory, you should add the write permission on the directory to the owner.

[oracle@primary01 export]$ chmod u+w ../export

Then remove the file again.

[oracle@primary01 export]$ rm ./exp_20220110.dmp
[oracle@primary01 export]$

If you're not the owner nor in the group of the directory, you can ask the system administrator for the write permission on the directory to others.

[root@primary01 /]# chmod o+w /backup/export

Or open all permission on the directory.

[root@primary01 /]# chmod -R 777 /backup/export

That's how we solve the error.

Leave a Reply

Your email address will not be published. Required fields are marked *