Tuesday, 12 December 2017

macos extended attributes xattr -d not removing extended attributes


For a simple local file owned by myself the following is having no effect:


1:37:51/spark-training-scripts:113 $ll  /shared/sparkeast.pem
-rw-r--r--@ 1 steve staff 1692 Mar 7 11:30 /shared/sparkeast.pem

Let us view the extended attributes:


11:44:00/spark-training-scripts:114 $xattr /shared/sparkeast.pem
com.apple.metadata:kMDItemWhereFroms
com.apple.quarantine

Attempt to delete the extended attributes (all of them):


11:44:24/spark-training-scripts:115 $xattr -d /shared/sparkeast.pem


No change:


11:44:28/spark-training-scripts:116 $xattr /shared/sparkeast.pem
com.apple.metadata:kMDItemWhereFroms
com.apple.quarantine

Answer



xattr -d will delete a single attribute, and you must specify the attribute name:


xattr -d com.apple.metadata:kMDItemWhereFroms /shared/sparkeast.pem
xattr -d com.apple.quarantine /shared/sparkeast.pem

Alternately, you can use xattr -c, which clears all extended attributes from the file:


xattr -c /shared/sparkeast.pem

No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...