In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to use the Linux watch command". Friends who are interested might as well take a look. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn how to use the Linux watch command.
Linux commonly used commands watch commands execute a given instruction periodically, and the instruction output is displayed in full screen mode. Watch is a very useful command, almost all Linux distributions come with this gadget, like the name, watch can help you monitor the results of a command, saving you from running it manually over and over again.
Watch can output the output of the command to the standard output device, which is mostly used to execute the command periodically / regularly.
Syntax watch (option) (parameter) option-n # or-- interval watch runs the program by default every 2 seconds, and you can specify the interval with-n or-interval. -d # or-- differences use the-d or-- differences option watch to highlight the changed area. The-d=cumulative option highlights where it has changed (regardless of the most recent change or not). -t # or-no-title closes the output of the watch command at the top of the interval, the command, the current time. -h,-- help # View help documentation parameter instructions: instructions that need to be executed periodically.
Example watch-n 1-d netstat-ant # command: highlight the change in the number of network links every second watch-n 1-d 'pstree | grep http' # highlights the change in the number of http links every other second. If the following command has a pipe character, you need to add''to reorganize the command area. Watch 'netstat-an | grep:21 |\ grep | wc-l' # View the number of connections established by a simulated attacking client in real time | grep scf' # monitors the changes of scf' files in the current directory watch-n 10' cat / proc/loadavg' # 10 seconds output the average load of the system watch uptime watch-t uptime watch-d-n 1 netstat-ntlp watch-d'ls-l | fgrep goface '# Monitoring goface file watch-t-differences=cumulative uptime watch-n 60 from # Monitoring mail watch-n 1 "df-I Df "# monitors the changes in the number of inode and block on disk FreeBSD and the difference between the watch command under Linux. Under Linux, watch periodically executes the next program and displays the execution result on full screen, such as: watch-n 1-d netstat-ant, while the watch command under FreeBSD is to check the running operations of other users. Watch allows you to peek at what other terminal is doing, which can only be used by super users.
At this point, I believe you have a deeper understanding of "how to use the Linux watch command". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.