11

How can I remove that '@' character from the file permissions?

'@' in file permissions for Mac/OSX machines, is used to show that an extended attribute is set with this file.

  1. Tried chmod 755 galaxy-ansible.yml but that didn't help.
  2. Tried echo | chmod -E galaxy-ansible.yml, didn't help (even with using sudo).
  3. Tried xattr -d galaxy-ansible.yml, that didn't help either (even with using sudo).

I even did the above operations as root user, still '@' character is not going away from file's permissions.

[arun@MacBook-Pro-2 ~/aks/anisble] $ ls -l@ galaxy-ansible.yml 
-rwxr-xr-x@ 1 arun  staff  270 Dec 22 12:31 galaxy-ansible.yml
    com.apple.quarantine     67 

My ~/aks folder is mapped to a CentOS vagrant box and if I'm on the vagrant box, doing ls -l doesn't give me '@' (as it's not a Max/OSX machine):

-rwxr-xr-x. 1 vagrant vagrant  270 Dec 22 00:12 galaxy-ansible.yml

On my Mac/OSX machine, there are other .yml files but those don't have '@' in the file permissions so I'm trying to remove '@' from galaxy-ansible.yml file (on Mac machine).

Right now the whole roles/.. folder has '@' character for any folder/files.

-rwxr-xr-x@ 1 arun  staff  1132 Dec 21 17:12 README.md
drwxr-xr-x@ 3 arun  staff   102 Dec 21 17:12 defaults
drwxr-xr-x@ 3 arun  staff   102 Dec 21 17:12 handlers
drwxr-xr-x@ 4 arun  staff   136 Dec 21 17:12 meta
drwxr-xr-x@ 5 arun  staff   170 Dec 21 17:12 tasks
drwxr-xr-x@ 7 arun  staff   238 Dec 21 17:12 templates
3
  • Possible duplicate of How do I remove the "extended attributes" on a file in Mac OS X? Dec 22, 2016 at 20:02
  • @FrankSchmitt Thanks Frank. Using xattr -c file or xattr -cr folder fixed it. I didn't look good enough.
    – AKS
    Dec 22, 2016 at 20:05
  • 3
    The way this question is phrased is helpful for a searcher that isn't familiar with the 'extended attributes' terminology (which is probably most people). So although it's a duplicate I found myself googling almost the identical question as phrased here and probably wouldn't have found the other question. Apr 16, 2018 at 17:02

1 Answer 1

42

The following commands helped in clearing the extended attribute at file / folder(recursive) level.

xattr -c <yourfilename>

or

xattr -cr <yourfoldername>
1
  • This didn't remove the '@' character in the file permissions of a .net maui project on mac for me
    – fonzane
    Jan 29 at 12:30

Not the answer you're looking for? Browse other questions tagged or ask your own question.