This post appeared originally in our sysadvent series and has been moved here following the discontinuation of the sysadvent microsite
pv
is a nice little tool that will take stdin and make a nice little
progress bar and displaying time elapsed, percentage completed (if size is known)
current throughput rate and the total data transferred and with an ETA.
So if you have a tool that can output it’s result on standard output or read from standard input, one can get a progress bar!
It’s nice to know that “data is flowing”.
Other examples
Send file with Netcat and get a nice progress-bar:
pv file | nc -w 1 example.com 3000
Get progress bar on tar output:
tar zcf - /directory | pv > backup.tar.gz
MySQL dump/restore:
mysqldump database | pv > database.sql
pv database.sql | mysql database
Limit the transfer rate and size of data over a pipe
cat /dev/zero | pv -L 3m -Ss 100m > /dev/null
Comparison of different compression tools
Working with various compressed files on a daily basis, I found I didn’t actually know how the different tools performed compared to each other. I know different compression will best fit different types of data, but I wanted to compare using a large generic file.
The setup
The file I chose was a 4194304000 byte (4.0 GB) Ubuntu installation disk image.
The machine tasked with doing of the bit-mashing was an Ubuntu with a AMD Ryzen 9 5900X 12-Core ... [continue reading]