Beware of the lsattr command – it can cause confusion!

Linux lsattr chattr

I was trying to remove an old file from my computer but for some reason was unable to delete it.

When I tried to remove it I got the message “rm: cannot unlink ‘filename’: Operation not permitted”

I was logged in as root when I tried this command – again unable to move / delete the file.

The file’s permissions are “-rw-r—–“.

The file is owned by root and I was also unable to chmod the file to expand the permissions.

lsattr (filename) if a "u" and a "i" turn up its made (i)mmutable and (u)ndeletable.
 chattr -iu (filename) to undo this.

admin has written 102 articles