1

I noticed I have one file that looks like this when I type ls -lah in the terminal:

-rw-r--r--@    1 bj5  1704   2.3M 13 Mar 16:12 All_Metadata.csv

I was just curious as to what the @ symbol means? I presumed it's a file attribute but I googled it and couldn't find any reference to it.

osgx
  • 90,338
  • 53
  • 357
  • 513
Ben Jeffrey
  • 714
  • 9
  • 18
  • 3
    This belongs *@* http://unix.stackexchange.com – Alex K. Mar 13 '17 at 16:32
  • ...or at [SuperUser](https://superuser.com/). From http://stackoverflow.com/help/on-topic -- a question has to be "unique to software development" to be a fit for SO. (In this case, it probably means that POSIX ACLs exist for the file, but that's going to be something specific to your OS -- it's not a convention true for all Unixen). – Charles Duffy Mar 13 '17 at 16:36
  • Ben, what is your Unix? Is it linux or BSD or Macos or something else? What is the version of your `ls` utility? – osgx Mar 13 '17 at 16:41

2 Answers2

3

Since you're tagged unix, the controlling standard that applies to all Unixen is IEEE 1003.1. Quoting from same:

The file mode written under the -l, -n, [XSI] [Option Start] -g, and -o [Option End] options shall consist of the following format:

"%c%s%s%s%s", <entry type>, <owner permissions>,
    <group permissions>, <other permissions>,
    <optional alternate access method flag>

The <optional alternate access method flag> shall be the empty string if there is no alternate or additional access control method associated with the file; otherwise, it shall be a string containing a single printable character that is not a <blank>.

Thus, this tells us that there is "an alternate or additional access control method associated with the file". Typically, this is something like an ACL, which a command like getfacl (on a Linux system) may retrieve and view.


Specifically for MacOS, however, the documentation ls specifies that presence of xattrs is shown with this character. Quoting from its man page:

If the file or directory has extended attributes, the permissions field printed by the -l option is followed by a '@' character. Otherwise, if the file or directory has extended security information (such as an access control list), the permissions field printed by the -l option is followed by a '+' character.

Thus, on MacOS, presence of ACLs is indicated with @, and ACLs are represented with +.

Charles Duffy
  • 280,126
  • 43
  • 390
  • 441
0

The "@" sign indicates that the file has extended attributes. You can use the command 'xattr -l ' to show them. It seems that a lot of Finder information, which ought to be stored in the catalog, is now in extended attributes.

Brian McCall
  • 1,831
  • 1
  • 18
  • 33
  • 1
    If xattrs, vs ACLs, are being displayed that way, that's arguably a violation of the relevant POSIX spec for `ls` (which reserves that character for "access control methods"). – Charles Duffy Mar 13 '17 at 16:40
  • Brian, where is this documented? – osgx Mar 13 '17 at 16:42
  • 1
    ...that said, from the MacOS `ls` man page, it looks like it does indeed behave this way, violation or no. – Charles Duffy Mar 13 '17 at 16:42
  • Copy of macos `man ls` online: https://ss64.com/osx/ls.html "*If the file or directory has extended attributes, the permissions field printed by the -l option is followed by an @ character. Otherwise, if the file or directory has extended security information, the permissions field printed by the -l option is followed by a + character.*"; duplicate of http://apple.stackexchange.com/questions/97241/ http://unix.stackexchange.com/questions/1646 – osgx Mar 13 '17 at 16:45