In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail about the use of linux watch command periodic execution command, Xiaobian feel quite practical, so share to everyone for a reference, I hope you can read this article after harvest.
The watch command executes a given instruction in a periodic fashion, and the output of the instruction is displayed full-screen. watch is a very useful command, basically all Linux distributions have this small tool, as the name, watch can help you monitor the results of a command, save you running it manually over and over again.
Syntax format: watch [parameter] [command]
Common parameters:
-n/--intervalwatch By default, the program runs every 2 seconds. You can specify the interval time with-n or-interval. -d/--differences The-d or--differences option watch highlights the changing areas. The-d=cumulative option highlights all changes (whether or not the most recent one has changed)-t/--no-title Close watch command Output at the top of the interval, command, current time-h/--help View help documentation
Reference Example
Repeat the uptime command:
[root@linuxcool ~]# watch uptime
Highlight changes in the number of network links every second:
[root@linuxcool ~]# watch -n 1 -d netstat -ant
Average load of output system every 10 seconds:
[root@linuxcool ~]# watch -n 10 'cat /proc/loadavg'
Monitor changes in disk inode and block numbers:
[root@linuxcool ~]# watch -n 1 "df -i;df"
Monitor changes to the test.txt file in the current directory:
[root@linuxcool ~]# watch -d 'ls -l| grep test.txt'about the use of linux watch command periodic execution command to share here, I hope the above content can be of some help to everyone, you can learn more knowledge. If you think the article is good, you can share it so that more people can see it.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.