2016-01-26 09:20:14 +01:00
|
|
|
# pv
|
|
|
|
|
|
|
|
> Monitor the progress of data through a pipe.
|
2021-10-06 14:51:52 -07:00
|
|
|
> More information: <https://manned.org/pv>.
|
2016-01-26 09:20:14 +01:00
|
|
|
|
|
|
|
- Print the contents of the file and display a progress bar:
|
|
|
|
|
2022-12-04 10:12:49 +01:00
|
|
|
`pv {{path/to/file}}`
|
2016-01-26 09:20:14 +01:00
|
|
|
|
2022-12-30 01:06:09 +02:00
|
|
|
- Measure the speed and amount of data flow between pipes (`--size` is optional):
|
2016-01-26 09:20:14 +01:00
|
|
|
|
2025-06-20 04:04:07 +10:00
|
|
|
`{{command1}} | pv {{[-s|--size]}} {{expected_amount_of_data_for_eta}} | {{command2}}`
|
2016-01-26 09:20:14 +01:00
|
|
|
|
|
|
|
- Filter a file, see both progress and amount of output data:
|
|
|
|
|
2025-06-20 04:04:07 +10:00
|
|
|
`pv {{[-cN|--cursor --name]}} in {{path/to/file.txt}} | grep {{pattern}} | pv {{[-cN|--cursor --name]}} out > {{path/to/filtered_file.txt}}`
|
2016-01-26 09:20:14 +01:00
|
|
|
|
|
|
|
- Attach to an already running process and see its file reading progress:
|
|
|
|
|
2025-04-22 06:20:48 +03:00
|
|
|
`pv {{[-d|--watchfd]}} {{PID}}`
|
2016-01-26 09:20:14 +01:00
|
|
|
|
|
|
|
- Read an erroneous file, skip errors as `dd conv=sync,noerror` would:
|
|
|
|
|
2025-06-20 04:04:07 +10:00
|
|
|
`pv {{[-EE|--skip-errors --skip-errors]}} {{path/to/faulty_media}} > {{path/to/image.img}}`
|
2016-01-26 09:20:14 +01:00
|
|
|
|
|
|
|
- Stop reading after reading specified amount of data, rate limit to 1K/s:
|
|
|
|
|
2025-06-20 04:04:07 +10:00
|
|
|
`pv {{[-L|--rate-limit]}} {{1K}} {{[-S|--stop-at-size]}} {{maximum_file_size_to_be_read}}`
|
|
|
|
|
|
|
|
- Calculate hash (MD5, SHA1, SHA256, etc) of a large file and show progress:
|
|
|
|
|
|
|
|
`pv {{path/to/file}} | {{sha256sum}}`
|