Linux file attributes

Have you ever received such an error when you are logged in as root? This error surprised me as I asked myself: Hang on a second! I am the super user, I should be able to change the permission of this regular file.

Look what prevents me from doing this;

Culprit is the file attribute “a” which means append. With “644” mode, I was trying to remove the write permission from the file but kernel didn’t let me do it because of this bit on. I would appreciate a cleaner error message indeed:) Once I clear the append flag, I successfully changed the permission.

There are a couple of more flags I like;

  • A : atime record of the file isn’t modified if set
  • S : changes are written synchronously on the disk
  • i : My favorite, the immutable bit. If set none can modify the file even can create a link

You have a feedback?