目次

Operation not permitted Cannot delete file

If an illegal file or similar is placed, there may be cases where the placed file cannot be deleted.
This is something that manipulates file attributes other than permissions in Linux's ext2 and ext3 file systems.

Cannot be deleted normally

# rm -rf ttyload
rm: cannot remove `ttyload': Operation not permitted

confirm lsattr

# lsattr ttyload 
s---ia------- ttyload

The file can be deleted if its attributes are modified.

# chattr -ia ttyload
# lsattr ttyload 
s------------ ttyload

If you want to prevent the file from being deleted, you can add attributes to it.

# chattr +ia ttyload
# lsattr ttyload 
s---ia------- ttyload

complete to remove

# rm -rf ttyload