I want to write some scripts that will measure the CPU use, but top
's output, while pleasant for the user, isn't really feasible for processing in a script.
Asked
Active
Viewed 824 times
3
2 Answers
5
Check $ man proc
. /proc
has a subdirectory for each pid on the system. Under each of those is a "stat" file, which includes CPU usage information for that specific pid.
EEAA
- 108,414
- 18
- 172
- 242