Benjamin Juang (ibneko) wrote,
Benjamin Juang

Removing xattr from files in a directory

Here's a one-liner to remove xattr from files in a directory on MacOS X. (Mostly to quickly strip out the annoying quarantine flag set on downloaded files).

for i in $(ls -Rl@ | grep '^ ' | awk '{print $1}' | sort -u); do echo Removing $i ... >&2; find . | xargs xattr -d $i 2>/dev/null ; done

Note the space after the ^ should be typed with control-v, then tab (to insert a proper tab).

Found this over at Posting it here so I don't lose the stupid thing again.
Tags: macos x

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded