Cv: command used to display the running Progress of Linux commands
Coreutils Viewer (cv) is a simple program that can be used to display any core component commands (such: cp, mv, dd, tar, gzip, gunzip, cat, grep, fgrep, egrep, cut, sort, xz, exiting) progress. It uses the file description to determine the progress of a command, such as the cp command. The beauty of cv is that it can be used with other Linux commands, such as watch and I/O redirection commands you know. In this way, you can use it in the script, or all the methods you can think of, don't let your imagination restrain you.
Grep uses concise and Regular Expressions
Use the cut command in Linux
Grep command details and related examples
Linux basic commands-grep
Set grep to highlight matching items
Linux grep command learning and summary
Install
You can download the source files from the github repository of cv. Download the zip file, decompress it, and enter the decompressed folder.
The program requires the ncurses library. If you have installed ncurses in your Linux system, the cv installation process is easy for you.
Follow these two simple steps to compile and install the SDK.
- $ Make
- $ Sudo make install
Run cv
To run cv, just enter this command in the command line like other programs. If you do not execute make install and choose to run it from the current directory, you can run the following command:
- $./Cv
Otherwise, run the following command.
- $ Cv
If no core component command is running, the cv program exits and tells you that no core component command is running.
To use this program effectively, run a core component program on your system. In this example, we will use the cp command.
When you copy a file, you can see the current progress as a percentage.
Add option to cv
You can also add several options to the cv command, just like other commands. A useful option is to let you know the estimated remaining time for copying or moving large files.
Add the-w option to display the estimated remaining time.
- $ Cv-w
Try to add more Command Options. Add other options as follows:
- $ Cv-wq
Cv and watch commands
Watch is a program used to periodically run programs and display output results. Sometimes, you may want to continuously check the command running status, rather than store the cv results in log files. In this case, watch will be used, and it can be used with cv.
- $ Watch cv-qw
This command displays the instances of all running core component commands. It also displays the progress and estimated completion time.
View output results in log files
As promised, you can use cv to redirect its output results to a log file. This function is especially useful when the command runs too fast and does not see any meaningful content.
To view the progress in the log file, you only need to redirect the output result, as shown below.
- $ Cv-w> log.txt
To view the output result of this command, use your favorite text editor to open the log file, or use the cat Command, as shown below:
- $ Cat log.txt
Get help
If you are in trouble, you can always obtain help information by checking the manual page or using the help option. To obtain help information, you can use the cv command with the-h option.
- $ Cv-h
If you need more details, the manual page is a good place.
- $ Man cv
However, to obtain the preceding manual page, you must execute make install to install cv.
Yeah! Now, you have a great tool in the Linux toolbox. Have you learned? Try it yourself ~
This article permanently updates the link address: