1

I recently start to use tar to backup my files on macOS.

I usually use:

tar cvf archive.tar foo bar

and i also run this to check:

tar tvf archive.tar 

It would show the following and it seems okay:

-rw-r--r--  0       6 Jan 20 22:40 foo
-rw-r--r--  0      13 Jan 20 22:40 bar

However, It seems likes this on Windows.

-rw-r--r--  0       6 Jan 20 22:40 ._foo
-rw-r--r--  0       6 Jan 20 22:40 foo
-rw-r--r--  0      13 Jan 20 22:40 ._bar
-rw-r--r--  0      13 Jan 20 22:40 bar

I'm confused about the result.

Why it would output ._foo and ._bar? Where are they from?

How could i make an archive.tar only output foo and bar without ._foo and ._bar?

3
  • 2
    You're probably seeing the resource forks/extended attributes, that Windows doesn't know what to do with. The Mac would wrap them back into the file. See superuser.com/questions/119928/… and superuser.com/questions/104500/what-is-macosx-folder
    – Tetsujin
    Commented Jan 20 at 14:21
  • @Tetsujin Thank you for your comment! It really help me a lot:)
    – carol
    Commented Jan 20 at 15:36
  • @Kamil Maciorowski Thank you for advice, i answer my own question, and i don't need futher help.
    – carol
    Commented Jan 20 at 15:41

1 Answer 1

2

It's indeed about extended attributes, and i export the following variable:

export COPY_EXTENDED_ATTRIBUTES_DISABLE=true
export COPYFILE_DISABLE=true

Now it wouldn't output ._file on windows.

1
  • You may accept your own answer two days later. Commented Jan 20 at 21:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .