Computer Setup

[OSX&Windows] ._ files in tar from Mac OSX

astrodoo 2019. 4. 23. 18:50

source1: https://superuser.com/questions/61185/why-do-i-get-files-like-foo-in-my-tarball-on-os-x

source2: https://apple.stackexchange.com/questions/14980/why-are-dot-underscore-files-created-and-how-can-i-avoid-them

 

Mac OSX 에서 압축한 것들을 다른 플랫폼에서 압축 해제할 때, ._ 파일들이 생성될 때가 있다.

이 때에는 아래와 같은 방법으로 해결할 수 있다.

 

 

1) OS X 설정 

OS X's tar also knows how to convert the ._ members back to native formats, but the ._ files are usually kept when archives are extracted on other platforms. You can tell tar to not include the metadata by setting COPYFILE_DISABLE to some value:

> COPYFILE_DISABLE=1 tar -cf 2.tar file*  

Or, you can insert the lines below in the .bash_profile:

# turn off special handling of ._* files in tar, etc.

COPYFILE_DISABLE=1; export COPYFILE_DISABLE

 

2) 이미 만들어진 압축파일을 열었을때 생성된 ._ 파일들 제거하기

> find . -type f -name '._*' -delete