1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-07-06 04:35:23 +02:00
tldr/pages/common/pv.md

33 lines
1.1 KiB
Markdown
Raw Normal View History

2016-01-26 09:20:14 +01:00
# pv
> Monitor the progress of data through a pipe.
> 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
- 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:
`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}}`