2

In a folder with a single file (image.jpg) I run the following commands

$ ls -a
.         ..        image.jpg
$ tar cf target.tar image.jpg

Listing contents of the archive

$ tar tvf target.tar
-rwxrwxrwx  0 Oskar  staff     190  8 Feb 12:14 ./._image.jpg
-rwxrwxrwx  0 Oskar  staff  404968  8 Feb 12:14 image.jpg

Extracting archive

$ tar xzf target.tar
$ ls -a
.         ..        image.jpg  target.tar

Why does the list of files in the archive show two files?

I'm running this in OSX 10.11.5.

$ tar --version
bsdtar 2.8.3 - libarchive 2.8.3

Extracting the same archive in Python using Tarfile.extractall() also extracts the ./._image.jpg file.

I've only seen this happen with .jpg files, .txt and .xml files works as expected.

10

0

Browse other questions tagged .