Coreutils Viewer (cv) is a simple program that can be used to show the progress of any of coreutils commands. It uses information from file descriptors to determine the progress of a command for example the cp command. The beauty of cv is that it can be used with other Linux commands like watch and I/O redirection commands as you shall see. This allows you to use it in a script, or however you like, your imagination will be the limit.
You can download the source files for cv from its github repository here. Once you have downloaded the zip file extract it and then change directory to the extracted folder.
The program dependencies is the ncurses library. If you have installed ncurses in your Linux box then installation of cv will be a breeze.
Compiling and installation can be done in two easy steps.
$ sudo make install
To run cv, just type it on the command line as other programs. If you did not make install and chose to run it from the current directory run the command as follows:
Otherwise, run the command as follows.
If there are no coreutils commands running then the cv program will exit and tell you, no coreutils program is running.
To effectively use the program have one of the coreutils programs running on your system. In this case we shall use the command cp.
Adding Options to cv
You can also add several option to the cv command just like other commands. One useful option is having to know the estimated time remaining for a copying operation or a move operation particularly for large files.
Adding the -w option will just do exactly that.
$ cv -w
Try adding more command options. Adding other options like this:
$ cv -wq
cv And watch Command
watch is a program used to run a program periodically and then show the output. Sometimes you might want to see the commands as they are running without storing the data in a log file. In this case watch comes in handy to use with cv.
$ watch cv -qw
View Output In A Log File
As promised, with cv you can redirect its output to a log file. This is particularly useful when the command runs too fast to see anything meaningful.
To see the progress in a log file you can simply redirect the output as in the command below.
$ cv -w >> log.txt
To see the output of this command open the log file with your favourite text editor or with the cat command as follows:
$ cat log.txt
If you get stuck anywhere you can always refer to the man page or the help option.
To get help use cv command with the -h option.
$ cv -h
If you need more detailed information then the man page would be a great place to visit.
$ man cv
However, to get the man page with the above command, ensure that you make install cv.
Yay! Now you have another great tool in your Linux toolbox.