linux

Copy a file with progress in Linux

You’ll need the “pv” program, which will monitor status through a pipe. On my Fedora box at work this was easy, ‘yum install -y pv’ (apt-get should work, also, for Debian based systems, but I haven’t confirmed that).

From there, running a “pv file1 > file2” gave me the following:

[user@system Downloads]$ pv Windows8-ConsumerPreview-64bit-English.iso > /media/6330-3630/download/Windows8-ConsumerPreview-64bit-English.iso
1.24GB 0:02:49 [5.03MB/s] [=============> ] 37% ETA 0:04:46

Yes, I have downloaded the Windows 8 Consumer Preview for use on my Dell Mini Duo. If there are any gotchas there I’ll write more about that in a separate blog post. Or maybe I’ll write about how flawlessly it worked. LOL

Another good use of pv is the following, which will restore to mysql from an SQL dump file (tip from here):

# pv database_backup.sql | mysql my_database
96.8MB 0:00:17 [5.51MB/s] [==> ] 11% ETA 0:02:10

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.