확장 속성이있는 모든 .webarchive 파일에서 xattr com.apple.quarantine을 제거하는 방법은 무엇입니까? gjp22 staff

여러 파일 시스템에 확산 OmniWeb에 의해 저장된 수많은 .webarchive 파일이 있습니다. 예를 들어 :

sh-3.2$ ls -@ 2012-03-19.webarchive
2012-03-19.webarchive
sh-3.2$ ls -@l 2012-03-19.webarchive
-rw-r--r--@ 1 gjp22  staff  3722852 19 Mar  2012 2012-03-19.webarchive
    com.apple.quarantine         26
sh-3.2$ xattr -l 2012-03-19.webarchive
com.apple.quarantine: 0000;4f66fcc8;OmniWeb.app;

이러한 파일은 확인되지 않은 개발자의 것으로 간주됩니다. Control- 클릭으로 각각 열 수는 있지만 지루합니다.

그래서 아마 관련된 명령 싶습니다 발견 (1) 에, 이러한 모든 확장 속성을 제거합니다 .



답변

find . -iname '*.webarchive' -print0 | xargs -0 xattr -d com.apple.quarantine
  • com.apple.quarantine 확장 속성 을 제거합니다 ( xattr -d ).
  • 확장자가 .webarchive ( -iname ‘* .webarchive’ ) 인 모든 파일에서
  • 현재 디렉토리 및 해당 서브 디렉토리에 있습니다 ( -depth가 내재 된 . -depth )
  • 공백과 다른 특수 문자를 포함하는 파일 이름의 문제를 피하기 위해 xargs ( -print0 | xargs -0 )를 거치는 경우 ( 비슷한 목표는을 사용하여 효율성을 약간 낮출 수 있습니다 find . -iname '*.webarchive' -exec xattr -d '{}' \;).

효율성 차이에 대한 설명 :

이 경우와 같이 구문이 허용 할 때마다 xargs는 다음과 같은 하나 이상의 명령 행을 어셈블합니다. xattr -d com.apple.quarantine /path/to/file1.webarchive /path/to/fileN.webarchive

my-in-opinion을 더 쉽게 기억할 수 find있지만 -only 버전은 매번 명령을 반복합니다.xattr -d com.apple.quarantine /path/to/file1.webarchive ; xattr -d com.apple.quarantine /path/to/fileN.webarchive


답변

이 작업을 수행하는보다 자동화 된 방법은 다음과 같습니다.

오토메이터 열기- “서비스”선택

붙여 넣기

on run {input, parameters}
    tell application "Terminal"
        activate
        set filesString to ""
        repeat with file_ in input
            set filesString to filesString & " " & quoted form of (POSIX path of file_)
        end repeat
        do script "xattr -r -d com.apple.quarantine" & filesString
    end tell
    return input
end run

“서비스 수신 선택”에 대해 “파일 또는 폴더”가 선택되어 있는지 확인하십시오. “in”으로 “Finder”가 선택되어 있는지 확인하십시오

그런 다음 저장을 누르고 격리 해제 이름을 지정하고 격리에서 제거하려는 폴더 또는 파일로 이동 한 다음 마우스 오른쪽 버튼을 클릭하고 격리 해제를 선택하십시오.

https://forums.macrumors.com/threads/%E2%80%9Cverifying%E2%80%9D-upon-opening-every-file.2065395/page-2#post-25134721