• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

CPU Usage in FreeBSD

reicherb

Platinum Member
I know there is a command to display CPU usage in Unix but I can't figure out what it is. Can anyone help me out?

Thanks.
 
I need something that will display just the total cpu usage. I am going to code it into a cgi script that I can't view on the web.

Thanks.
 
top will do that, do a man top or pipe the top output to a file and grep the file for the data... It is there... In the header section when it is running...
 
Technically you would be redirecting the output to a file, not piping it to a file. If you issue top with the -b switch it runs in batch mode, meaning it does one iteration and exits. What you can do is pipe that output to grep, awk, cut, tr, whatever and manipulate that output to whatever output you like, then redirect it to a file for use somewhere else.

There has to be a way to do this with ps though. I just don't feel like reading through all of the man page on ps to find out how to manipulate the output accordingly. You can manipulate tops output as well with switches, etc.
 
Back
Top