pv: a handy replacement for cat when piping large amounts of data into commands

If you’re ever in the situation of needing to pipe a large amount of data into a program and would usually use cat or just redirect from a file, but would like some idea of how long it may take, then may I recommend to you the “pv” command (packaged in Debian/Ubuntu/RHEL/etc)?

For instance, here is restoring a 9GB MySQL dump into a MariaDB database:

root@db3:/var/tmp# pv db4.sql | mysql
 570MB 0:02:06 [5.01MB/s] [>                                   ]  5% ETA 0:34:28

Suddenly you’ve got the data rate, the percentage complete and an ETA so you can go off and get a coffee whilst it works..