# 归档文件加解压

终端归档加解压，一般使用tar,unzip,gzip等等。tar一般自带。

```
pkg install unzip unrar
```

zip:

```
#　解压：
unzip FileName.zip

#　压缩：
zip FileName.zip DirName

#　压缩一个目录使用 -r 参数，-r 递归。例:
zip -r FileName.zip DirName
```

gzip:

```
# 压缩 ：
gzip -v FileName.log

#  读取压缩文件：
zcat FileName.log.gz

#  解压缩：
gzip -d FileName.log.gz

#  解压 ：
gunzip FileName.gz

#  添加到一个新的压缩文件：
gzip -9 -c FileName.log > FileName.log.gz
```

tar:

```
# 归档：
tar -cvf FileName.tar file1

#  查看归档包中的内容 ：
tar -tf FileName.tar

#  解压归档包 ：
tar -xvf FileName.tar

#  将压缩包释放到 /data01目录下 ：
tar -xvf FileName.tar -C /data01
```

tips:如果使用oh-my-zsh还可以使用extract插件，解压文件很简单，只要:`x file`

更多归档管理可以参考：<https://bbs.zsxwz.com/thread-2699.htm>


---

# 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://termux-wiki.zsxwz.com/untitled/gui-dang-wen-jian-jia-jie-ya.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.
