# zip

## ZIP

* most commonly used archiving format out there today
* available on all OSs
* not best compression

Compress:

`zip -r archive_name.zip directory_to_compress`

Extract:

`unzip archive_name.zip`

## TAR

* common on Linux
* consumes very little time and CPU to compress files,
* compression minor

Compress:

`tar -cvf archive_name.tar directory_to_compress`

Extract:

`tar -xvf archive_name.tar.gz`

Extract to specific dir

`tar -xvf archive_name.tar -C /tmp/extract_here/`

## TAR.GZ

* pretty great with good compression and not too much CPU

Compress:

`tar -zcvf archive_name.tar.gz directory_to_compress`

Extract:

\# **tar -zxvf archive\_name.tar.gz**

Extract to specific dir:

\# **tar -zxvf archive\_name.tar.gz -C /tmp/extract\_here/**

## TAR.BZ2

* best compression with most CPU

`tar -jcvf archive_name.tar.bz2 directory_to_compress`

Extract to specific dir:

`tar -jxvf archive_name.tar.bz2 -C /tmp/extract_here/`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://openai.gitbook.io/code-cheatsheets/all/bash/zip.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
