How do I remove the “extended attributes” on a file in Mac OS X?

前端 未结 5 1708
时光说笑
时光说笑 2020-12-02 03:22

I have an AppleScript script that runs a stress test. Part of the test is to open, save, and close certain files. Somehow, the files have picked up some \"extended attribute

5条回答
  •  星月不相逢
    2020-12-02 03:57

    Another recursive approach:

    # change directory to target folder:
    cd /Volumes/path/to/folder
    
    # find all things of type "f" (file), 
    # then pipe "|" each result as an argument (xargs -0) 
    # to the "xattr -c" command:
    find . -type f -print0 | xargs -0 xattr -c
    
    # Sometimes you may have to use a star * instead of the dot.
    # The dot just means "here" (whereever your cd'd to
    find * -type f -print0 | xargs -0 xattr -c
    

提交回复
热议问题