Sometimes when you download lots of junk from the internet, MacOSX likes to stomp all over your files leaving pesky little sprinkles of annoyance called “extended attributes”
They show up when ever you ls -l
as little @
symbols at the end of the file mode section.
1 | [~/tmp] |
You can view the attributes with the xattr
command:
1 | [~/tmp] |
There is also a handy switch to ls
that can show them inline:
1 | [~/tmp] |
You can remove them one at a time with xattr -d $NAME_OF_ATTRIBUTE
, but this is really obnoxious. You first would have to look up which attributes are applied, and then type in the name of each one.
So I’ve got this script in my $PATH
that can do it for me.
1 |
|
Now when I want to kill them, it’s an easy one-liner:
1 | [~/tmp] |
You could even do a whole folder at once with xattr-rm *
or use find .
to -exec
the command over every file in a directory.
Yay scripting!