xattr
권한·소유
쓰는 꼴
xattr -l [file]macOS에서 확장 속성을 읽고 지웁니다. 대개는 com.apple.quarantine — 앱이 손상되었다는 그 경고의 정체이고, 리눅스는 getfattr와 setfattr을 씁니다.
자주 쓰는 옵션
| 옵션 | 뜻 |
|---|---|
| -l | List the attributes with their values |
| -p | Print one named attribute |
| -w | Write one named attribute |
| -d | Delete one named attribute |
| -c | Clear every attribute on the file |
| -r | Work through a directory recursively |
예시
xattr -l installer.dmgShows com.apple.quarantine on anything downloaded.
xattr -d com.apple.quarantine /Applications/App.appClears the flag behind the damaged app warning.
xattr -cr ./MyApp.appStrips every attribute through the whole bundle.
숫자 모드와 문자 모드가 같은 것을 가리킵니다. 755와 u=rwx,go=rx는 같은 뜻입니다.
읽는 방법
- 대괄호 [ ]는 넣어도 되고 안 넣어도 되는 자리입니다.
- 점 셋 …은 여러 개를 이어 쓸 수 있다는 뜻입니다.
- 옵션은 대소문자를 가립니다 — -r과 -R이 다른 명령도 있습니다.
자주 묻는 것
Q. xattr은 무엇을 하나요?
macOS에서 확장 속성을 읽고 지웁니다. 대개는 com.apple.quarantine — 앱이 손상되었다는 그 경고의 정체이고, 리눅스는 getfattr와 setfattr을 씁니다.
Q. 어떻게 치나요?
xattr -l [file] — 대괄호는 생략할 수 있는 자리입니다.
Q. 옵션은 몇 개나 자주 쓰나요?
여기 정리한 것은 6개입니다. 전체 목록은 man xattr에 있습니다. 이 명령은 권한·소유 갈래입니다.
같이 보는 명령
man 페이지: man xattr