How to monitor progress of UNIX utilities (cp, mv, rm, etc.)


cv - Coreutils Viewer

With cv you can monitor what coreutils you got running on your machine, and display what state they are in. This is especially nice to have if you are processing a lot of data, and need some kind of time estimate.

How to install

Go ahead and download the zip from Github (https://github.com/Xfennec/cv):

$ curl -OL https://github.com/Xfennec/cv/archive/master.zip

Unzip it:

$ unzip master.zip

Change dir into cv:

$ cd master-cv

Now you are ready to install it from source with make:

$ make && make install

The cv command should now be executable from your prompt.

Usage

The most simple way to use cv is probably with watch. The watch program creates a fullscreen which updates every 2 second. Lets start cv in quite mode with watch:

$ watch cv -q

I tested with a $ cp -r * cvtest/ command, and got output similar to the following:

Every 2.0s: cv -q        Sun Jul 20 09:20:59 2014

[25254] cp /root/logstashtest/elasticsearch-1.1.0
/plugins/kopf/_site/es-plugin.properties 0.0% (0
/ 81 B)

This will change every 2s, and you will be able to see what exactly is going on.

pv - monitor the progress of data through a pipe

Another simple way to monitor this is with the pv command. It is as simple as the man description. You can pipe every util that process data from one source to another, and it will calculate some kind of progress. You use it simply by piping:

$ cp -r * cvtest/ | pv

You will get a simple bar with output of B transfered, B/s, time used, and time estimate:

   0B 0:00:0 [ 0B/s ] [<=>                           ]