I gzip directories very often at work. What I normally do is
tar -zcvf file.tar.gz /path/to/directory
Is there a way to specify the compression level here? I want to use the best compression possible even if it takes more time to compress.
|
I gzip directories very often at work. What I normally do is
Is there a way to specify the compression level here? I want to use the best compression possible even if it takes more time to compress.
| |||
|
feedback
|
|
Instead of using the gzip flag for tar, gzip the files manually after the tar process, then you can specify the compression level for the gzip program:
Or you could use:
The -9 in the gzip command line tells gzip to use the maximum possible compression level (default is -6). Edit: Fixed pipe command line based on @depesz comment | ||||
feedback
|
|
No. You will have to drop the compression from | |||
|
feedback
|
assuming you're using bash. Generally, set GZIP environment variable to "-9", and run tar normally. Also - if you really want best compression, don't use gzip. Use lzma or 7z. And when using gzip (which is good idea for various of reasons anyway) consider using | |||||
feedback
|