I was changing file permissions and I noticed that some of the permissions
modes ended in @ as in [email protected], or a + as in drwxr-x---+. I’ve looked
at the man pages for chmod and chown, and searched around different help
forums, but I can’t find anything about what these symbols mean.
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
+ means that the file has additional ACLs set. You can set them with setfacl and query them with getfacl:
<a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="375a5645435e59775a5645435e59">[email protected]</a> ~ % touch file <a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="a1ccc0d3d5c8cfe1ccc0d3d5c8cf">[email protected]</a> ~ % ll file -rw-rw-r-- 1 martin martin 0 Sep 23 21:59 file <a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="bdd0dccfc9d4d3fdd0dccfc9d4d3">[email protected]</a> ~ % setfacl -m u:root:rw file <a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="5934382b2d30371934382b2d3037">[email protected]</a> ~ % ll file -rw-rw-r--+ 1 martin martin 0 Sep 23 21:59 file <a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1974786b6d70775974786b6d7077">[email protected]</a> ~ % getfacl file # file: file # owner: martin # group: martin user::rw- user:root:rw- group::rw- mask::rw- other::r--
I haven’t seen @ yet personally, but according to this thread it signifies extended attributes, at least on MacOS. Try xattr -l on such a file.
Method 2
The @ on OSX means that they’re extended attributes. See here, or alternatively check out the man page man xattr.
Example
$ ls -lF *.pdf <a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c7eab5b0eab5eaeab5eaea87">[email protected]</a> 1 wgscott staff 222K Feb 27 17:08 1229.pdf
The @ tells you that the file has some form of extended attribute associated with it. Let’s have a look:
$ xattr -l 1229.pdf com.apple.metadata:kMDItemWhereFroms: 0000 62 70 6C 69 73 74 30 30 A1 01 5F 10 37 68 74 74 bplist00.._.7htt 0010 70 3A 2F 2F 77 77 77 2E 73 63 69 65 6E 63 65 6D p://www.sciencem 0020 61 67 2E 6F 72 67 2F 63 67 69 2F 72 65 70 72 69 ag.org/cgi/repri 0030 6E 74 2F 33 32 33 2F 35 39 31 38 2F 31 32 32 39 nt/323/5918/1229 0040 2E 70 64 66 08 0A 00 00 00 00 00 00 01 01 00 00 .pdf............ 0050 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00 00 ................ 0060 00 00 00 00 00 44 .....D com.apple.quarantine: 0000;49a88e87;Safari.app;|com.apple.Safari
Method 3
For those searching for why they can’t edit a file with “@” or “+” at the end of it on mac osx, the reason is probably related to metadata, for example the file was copied from a Time Machine backup via the terminal and not file explorer.
Two steps will remove the metadata and make it writeable again on MacOS:
# Remove the metadata attributes xattr -c <some file> # Remove the file ACL(s) chmod -N <some file>
Method 4
As others have noted, it is indeed metadata. One of the uses for this is to store download information such as where the file was downloaded from. This allows MacOS to query you about opening a file downloaded from the Internet, for example:
$ xattr -p -l com.apple.metadata:kMDItemWhereFroms foo com.apple.metadata:kMDItemWhereFroms: 00000000 62 70 6C 69 73 74 30 30 A2 01 02 5F 10 68 68 74 |bplist00..._.hht| 00000010 74 70 3A 2F 2F 64 6F 77 6E 6C 6F 61 64 73 2E 70 |tp://downloads.p| 00000020 65 72 66 73 6F 6E 61 72 2E 6E 65 74 2F 72 65 64 |erfsonar.net/red| 00000030 68 61 74 2F 6D 61 69 6E 2F 72 70 6D 73 2F 65 6C |hat/main/rpms/el| 00000040 36 2F 69 33 38 36 2F 6D 61 69 6E 2F 52 50 4D 53 |6/i386/main/RPMS| 00000050 2F 70 65 72 66 73 6F 6E 61 72 2D 75 69 2D 77 65 |/perfsonar-ui-we| 00000060 62 2D 31 2E 37 2E 31 2E 65 6C 36 2E 6E 6F 61 72 |b-1.7.1.el6.noar| 00000070 63 68 2E 72 70 6D 5F 10 2B 68 74 74 70 3A 2F 2F |ch.rpm_.+http://| 00000080 64 6F 63 73 2E 70 65 72 66 73 6F 6E 61 72 2E 6E |docs.perfsonar.n| 00000090 65 74 2F 69 6E 73 74 61 6C 6C 5F 70 73 75 69 2E |et/install_psui.| 000000A0 68 74 6D 6C 08 0B 76 00 00 00 00 00 00 01 01 00 |html..v.........| 000000B0 00 00 00 00 00 00 03 00 00 00 00 00 00 00 00 00 |................| 000000C0 00 00 00 00 00 00 A4 |.......| 000000c7
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0