How to find OS information in Linux like Top?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Dinesh Sivaling
    New Member
    • Dec 2010
    • 4

    How to find OS information in Linux like Top?

    If u type top command in terminal u will get like this..........
    For eg.

    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    31253 user1 16 0 2112m 2.1g 1764 R 37.0 53.2 0:39.89 firefox
    31249 root 16 0 2112m 2.1g 1764 R 15.5 53.2 0:38.29 gtk-gnash
    31244 veer 16 0 2112m 2.1g 1764 R 13.6 53.2 0:40.05 metacity
    31250 user1 16 0 2112m 2.1g 1764 R 13.6 53.2 0:41.23 gnome-terminal
    31242 root 16 0 2112m 2.1g 1764 R 12.9 53.2 0:40.56 java
    31238 user1 16 0 2112m 2.1g 1764 S 12.6 53.2 1:22.21 java

    My Question is
    Where they are getting information for USER , %CPU , %MEM & TIME+ in Linux ???????.
    this i have to done in code ...without using gliptop ........so how they are getting these information from which directory and how they are calculating.... .....i had seen many question regarding this on net but no one gave proper answer ..........
    If anyone knows about this information please tell......
    Any help is greatly appreciated.... ...
Working...