课程: Linux Tips

免费学习该课程!

今天就开通帐号,24,700 门业界名师课程任您挑!

Using watch and time

Using watch and time

- [Instructor] In this episode, I'd like to take a few minutes to show you two commands that can be used monitor and measure activities. The first one called watch, runs a command at a given interval and displays the output. And the second, called time, shows you how long a command took to run. The watch command is useful if you have a program that gives you output, but you want to see how that output changes over time. For example, the df command shows the amount of space used and free on a given file system, but only at the moment in time when it runs. In order to show the watch command in action, I'll open up tmux here on my system, and then split the screen so we can see the output of df, and also make changes that will affect the output. Now I'll run df but with the watch command in front of it. By default, watch runs whatever you give it every two seconds, as we can see up in the top left here, though that interval…

内容