Find the answer to your Linux question:
Results 1 to 4 of 4
Dear all, i am sure that all of us know the result of top command in linux. i want to get the value that the top command return as CPU ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2009
    Posts
    1

    Question How can i get the value of CPU usage anh memory usage


    Dear all,

    i am sure that all of us know the result of top command in linux. i want to get the value that the top command return as CPU usage, memory usage.

    so how do i do(programming relation)?

    thanks.

  2. #2
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,677
    Hmmm, have you looked at the following:

    /proc/stat
    /proc/meminfo

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  3. #3
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    vmstat command takes information from those files and makes it more readable and general

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,677
    Nice program, thnx.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •