Cv: command used to display the running Progress of Linux commands

Source: Internet
Author: User

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.

  1. $ Make
  2. $ 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:

  1. $./Cv

Otherwise, run the following command.

  1. $ 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.

  1. $ Cv-w

Try to add more Command Options. Add other options as follows:

  1. $ 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.

  1. $ 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.

  1. $ 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:

  1. $ 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.

  1. $ Cv-h

If you need more details, the manual page is a good place.

  1. $ 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:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.