linux watch
时间: 2023-10-23 07:42:33 浏览: 61
The "watch" command in Linux is used to execute a specific command repeatedly at a specified interval and display the result in the terminal. The syntax of the command is:
watch [options] command
For example, if you want to monitor the disk space usage on your system, you can use the following command:
watch df -h
This will display the disk usage statistics every 2 seconds by default. You can also specify a different interval using the "-n" option followed by the number of seconds. For example:
watch -n 5 free -m
This will display the memory usage statistics every 5 seconds. Other useful options include "-d" to highlight the differences between the output of each command execution and "-t" to display the title of the command in the header of the output.
阅读全文