Sponsored Content
Full Discussion: Someone help me
Special Forums UNIX Desktop Questions & Answers Someone help me Post 51655 by zazzybob on Thursday 27th of May 2004 08:23:47 AM
Old 05-27-2004
Just thinking about this one again....

If you want to get current CPU info (CPU states, processes, etc) you could run top in non-interactive batch mode (in Linux at least).

Code:
top -b -n 1 > top.out

This runs 1 iteration of top and saves the output in plain text format to top.out.

Cheers
ZB
 
UPTIME(1)							Linux User's Manual							 UPTIME(1)

NAME
uptime - Tell how long the system has been running. SYNOPSIS
uptime uptime [-V] DESCRIPTION
uptime gives a one line display of the following information. The current time, how long the system has been running, how many users are currently logged on, and the system load averages for the past 1, 5, and 15 minutes. This is the same information contained in the header line displayed by w(1). System load averages is the average number of processes that are either in a runnable or uninterruptable state. A process in a runnable state is either using the CPU or waiting to use the CPU. A process in uninterruptable state is waiting for some I/O access, eg waiting for disk. The averages are taken over the three time intervals. Load averages are not normalized for the number of CPUs in a system, so a load average of 1 means a single CPU system is loaded all the time while on a 4 CPU system it means it was idle 75% of the time. FILES
/var/run/utmp information about who is currently logged on /proc process information AUTHORS
uptime was written by Larry Greenfield <greenfie@gauss.rutgers.edu> and Michael K. Johnson <johnsonm@sunsite.unc.edu>. Please send bug reports to <albert@users.sf.net> SEE ALSO
ps(1), top(1), utmp(5), w(1) Cohesive Systems 26 Jan 1993 UPTIME(1)
All times are GMT -4. The time now is 09:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy