Benjamin Juang (ibneko) wrote,
Benjamin Juang
ibneko

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 http://zzamboni.org/brt/2008/05/07/removing-all-extended-attributes-from-a-directory-tree/index.html. Posting it here so I don't lose the stupid thing again.
Tags: macos x
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments