0

Under /usr/cti/APP_sys, I have hundreds of directories and subdirectories and files, etc.

I wonder what the best approach in order to compress the /usr/cti/APP_sys directory (get the best low capacity of APP_sys).

Meanwhile I use the following command

   tar –zcvf  APP_sys.gz  APP_sys

but my target is to find the best approach in order to get the best low capacity from APP_sys directory.

   tar Common Options:
   -C, --directory DIR
   -f, --file F
   -j, --bzip2
   -p, --preserve-permissions
   -v, --verbose
   -z, --gzip
maihabunash
  • 7,131

3 Answers3

1

You can decouple the "package all files together" part from "compress as much as possible" and play around with different compression options to see which has an acceptable trade off between time/memory/size:

tar cvf - ./APP_sys | gzip -9 > APP_sys.tar.gz

Or

tar cvf - ./APP_sys | bzip2 --best > APP_sys.tar.gz

Or

tar cvf - ./APP_sys | xz -9e > APP_sys.tar.xz

Which file compression software for linux offers the highest size reduction?

0

xz has the best rate of compression i have seen and is installed by default on most solutions.

tar -Jcvf APP_sys.tar.xz /usr/cti/APP_sys
Rui F Ribeiro
  • 56,709
  • 26
  • 150
  • 232
0

The tar command will store one full path for each file. Which can represent a great volume if the files are numerous and the paths are long.

You should try commands that manage a file index like p7zip .

Emmanuel
  • 4,187