Discrepancy in the size of compressed file

I was trying to compress a folder into .tar format.

The folder size is around 76 MB.

Suppose I want to compress the folder myfolder to my-compressed-folder (in tar format)

I tried 2 approaches:

1) In the terminal, I executed:

tar -cjvf my-compressed-folder myfolder

The size of .tar by this method is 23 MB

2) On using the in-built Compress after right clicking on myfolder & choosing the .tar.xz, the size of .tar is around 17 MB.

I have 2 doubts:

1) How is there so much size difference in the 2 compressed files in same (.tar) format?

2) Is there any Linux command by which I can create compressed .tar files with the compression ratio same as the in-built Compress feature of Ubuntu?

My system details are as follows:

Ubuntu Desktop
Version 18.04.4 LTS (64-bit)
0
задан 11 May 2020 в 20:55

1 ответ

От man tar :

  -j, --bzip2
 Фильтруйте архив через bzip2 (1).

 -J, --xz
 Фильтруйте архив через xz (1).

Итак, ваша команда tar -cjvf my -ressed-folder myfolder создала сжатый bzip2 архив, а не сжатый xz.

Для сравнения яблок с яблоками с tar.xz файл, который вы создали из файлового менеджера, вы должны использовать tar -cJvf my -ressed-folder myfolder .

0
ответ дан 19 June 2020 в 21:41

Другие вопросы по тегам:

Похожие вопросы: