84

I was changing file permissions and I noticed that some of the permissions modes ended in @ as in -rw-r--r--@, 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.

0

4 Answers 4

51

+ means that the file has additional ACLs set. You can set them with setfacl and query them with getfacl:

martin@martin ~ % touch file
martin@martin ~ % ll file 
-rw-rw-r-- 1 martin martin 0 Sep 23 21:59 file
martin@martin ~ % setfacl -m u:root:rw file 
martin@martin ~ % ll file 
-rw-rw-r--+ 1 martin martin 0 Sep 23 21:59 file
martin@martin ~ % 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.

1
  • 5
    Just a quick note: it doesn't look like OSX has setfacl or getfacl. Instead, it packs that extra functionality into chmod. Martin's answer pointed me to the right search terms, which turned up this page: thomaskeller.biz/blog/2011/06/04/acls-on-mac-os-x
    – Nathan
    Sep 23, 2013 at 20:13
28

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>
2
  • My excel has several sheets, xattr -c can get rid of the @, but attempt to save one sheet as text only resulted in failure, then the @ appeared after this operation. This is on Mac. It is really annoying.
    – Kemin Zhou
    Nov 2, 2019 at 19:11
  • @KeminZhou - This is another example of Apple "thinking differently" - but not thinking better. I use a Mac for professional use, but gripe all the time about silly things like no way to paste a path into the finder app to navigate. Jul 17, 2020 at 17:57
27

The @ on OSX means that they're extended attributes. See here, or alternatively check out the man page man xattr.

Example

$ ls -lF *.pdf
-rw-r--r--@ 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
0
1

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .