Sometimes, while copying a large file, like a movie or an operating system image, the
cp command takes longer than expected based on the load on your system. Since it doesn’t tell the progress of the operation, it gets difficult to understand what exactly is happening.
In scenarios like these, a command like
cv could be of great help, as it not only lets you know the progress of the operation, but is also capable of displaying the remaining time. In this article, we will discuss the command along with some useful examples.
cv command is a utility that looks specifically for coreutils basic commands, such as
cat, and more, currently running on your system and displays their progress percentage. Although it is Linux-specific, a Mac OSX port is also available.
Download and Install
To download and install the
cv command, head to its Github repository and download the source package (the name of downloaded file in my case was “cv-master.zip”). Once done, extract the files using the following command:
Enter the “cv-master” directory and run the following commands to build the package and install the binary:
Please note that the
cv command depends on the “ncurses” library, so you may have to install corresponding packages which can be done by running the following command:
Another point worth noting is that after installation, the binary goes into “/usr/local/bin”, so make sure that the path is added to your system environment, otherwise your shell won’t be able to find the command when you run it. An alternative would be to change your current directory to “/usr/local/bin” and then execute the command in the following way:
Here are some examples of how this command can be used:
Note: All examples presented in this article are tested on Ubuntu 14.04.
A basic example
cv command displays the progress of other commands that are running, there has to be a command that runs sufficiently long so that the
cv command could display anything. For example, I tried copying a huge file from my pen-drive to my Linux box, and as the
cp command was executed, I immediately switched to another shell tab and executed the following command:
The command displayed the following output:
The first field in the output is the PID of the command being monitored, followed by the command and the progress in percentage as well as numbers. A point worth noting is that the first line in the output of the
cv command (
cat inactive/flushing/streaming/...) is default – I checked the code and found that the line gets printed under certain conditions, which apparently always gets hit (we can ignore it for now).
If more than one command is running, the
cv command displays the progress related to all of them. For example, here is the output with two commands running:
Get an estimated I/O throughput and ETA
While it is useful to know the progress of a command, it’s even more convenient if you get to know other information like the time remaining or ETA. For this, the
cv command offers the
-w command line option.
For example, when the following command was executed:
the following output was displayed:
The last two fields in the output, which represent estimated I/O throughput and ETA, signify that the copy operation is progressing at a rate of 27.9 MB per second, and will take 32 seconds to complete.
Loop the command
While using the
cv command, you’ll notice that it shows the progress details at that instant and then terminates. To make sure that
cv does not terminate until the command being monitored terminates, use the
This will make sure that the
cv command loops while monitored processes are still running.
cv command could be an asset for those that deal with transferring heavy files or other time-consuming operations on the Linux command line. Needless to say, being open source, you can change the way it interacts and works by making changes to its code base, which is quite small and easy to understand.
Have you ever used
cv or any other similar command? How was your experience? Share your thoughts in the comments below.