Linux Commands-Watch: Execute commands repeatedly, full screen display output

Source: Internet
Author: User

The watch command executes the command periodically, displaying the output in full screen. A program can be repeatedly executed by the Watch command to monitor its output changes.

Command format

Watch [-DHVT] [-n <seconds>] [--differences[=cumulative]] [--help] [--interval=<seconds>] [--no-title] [-- Version] <command>

Command parameters

-N,--interval
Specify a time interval. By default, watch executes the command every 2 seconds.

-D,--differences
Highlight the area of change. The-d=cumulative option highlights all areas that have changed (including those that have been changed).

-T,-no-title
Close the time interval, commands, and so on that appear at the top.

-H,--help
Show Help Document

Instance

A) All TCP protocol connections are displayed every 2 seconds

Watch Netstat-ant

b) Display of user information logged in every 30 seconds

Watch-n W

c) Monitor a file to highlight its changing content

Watch-d Cat/proc/loadavg

Linux Commands-Watch: Execute commands repeatedly, full screen display output

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.