# PV的使用

PV 全命為 Pipe Viewer ，利用它我們可以查看到命令執行的進度。

用法：pv \[OPTION] \[FILE] ...

將FILE（或標準輸入）連接到標準輸出，監督。

## **使用pv 命令監控Linux 命令的執行進度**

### **複製文件**

```
pv xxx.iso > aaa.iso
```

### **複製文件（限速2MB/s）** \*

```
pv -L 2m xxx.iso > aaa.iso
```

### &#x20;顯示ssh傳輸的network throughput

```
yes|pv|ssh 120.115.4.238 "cat > /dev/null"
```

### 顯示進度條的同時計&#x7B97;**/ etc / hosts**文件中的行數，字數和字節數，請在下面運行此命令

```
pv -p /etc/hosts | wc
```

```
tar -czf - ./Downloads/ | (pv -p --timer --rate --bytes > backup.tgz)
tar -czf - ./Documents/ | (pv -n > backup.tgz) 2>&1 | dialog --gauge "Progress" 10 70
```

從/ var / log / syslog文件製作一個zip文件，請運行以下命令

```
pv /var/log/syslog | zip > syslog.zip
```


---

# 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://kawsing.gitbook.io/opensystem/andoid-shou-ji/untitled-4/linux-cli/pv-de-shi-yong.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.
