Questions tagged [xattr]

Extended attributes (commonly called "xattrs") are a way to associate metadata with files/directories in the filesystem.

Extended file attributes can be used to store information such as MIME type, checksums, cryptographic keys/certificates, etc; attributes are not interpreted by the filesystem (unlike the normal file attributes). They require operating system and filesystem support; not all operating systems and/or filesystems support them.

For more about extended file attributes, see the Wikipedia article.

107 questions
2
votes
1 answer

Append only attribute for directories

I want to create a directory which is undeletable, and that you can only add files, not delete any file therein. I was reading the man chattr page and I came across attribute a A file with the 'a' attribute set can only be opened in append mode for…
1
vote
0 answers

Is the purpose of setting the version number of a file using chattr similar to optomistic locking in a database?

For instance if you record the version number before editing the file, and check it again before saving the file, you can be assured that nobody else wrote to the file while you were editing it. (although to be honest I don't see it changing the…
leeand00
  • 4,615
0
votes
1 answer

What is `chattr +x` used for?

The chattr(1) manpage describes the x attribute as: x The 'x' attribute can be set on a directory or file. If the attri‐ bute is set on an existing directory, it will be inherited by all files and subdirectories that are…
0
votes
1 answer

How to lsattr directory only?

I have a directory called pub on a Ubuntu 20.04 server, that I wish to protect from deletion, and I found https://askubuntu.com/questions/504151/how-to-prevent-directory-from-being-deleted-by-user so I tried: $ sudo chattr +i pub Good enough, now I…
sdbbs
  • 480