> For the complete documentation index, see [llms.txt](https://til.yulrizka.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://til.yulrizka.com/unix/specify-compression-level-in-tar-gzip.md).

# specify compression level in tar gzip

from <http://superuser.com/questions/305128/how-to-specify-level-of-compression-when-using-tar-zcvf>

```
GZIP=-9 tar cvzf file.tar.gz /path/to/directory
```

or

```
tar cvf - /path/to/file0 /path/to/file1 | gzip -9 - > files.tar.gz
```
