I have to run top in my machine (mac osx), and get the cpu usage from there, in real time.
How can I do that?
I tried running top and saving it but it must end before it saves it.
Thank you.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The -n command line option lets you run top for the specified number of cycles, then exit. So
top -n 1just runs it once and you can parse the output.