000 permission for a single file is not working well [duplicate]
What's wrong?
Nothing. Removing all permissions from a file does not prevent deletion or renaming - those are controlled by the permissions of the containing directory (Desktop
, in this case). If you want to prevent deletion or renaming, remove write permissions from the directory:
chmod a-w Desktop
Or make the files immutable:
sudo chattr +i Desktop/*.gif
rm
will ask you if you want to delete an immutable file, but it can't:
$ rm foo
rm: remove write-protected regular file ‘foo’? y
rm: cannot remove ‘foo’: Operation not permitted