1.

How to get a list of currently running processes and resource utilization in Linux?

Answer»

Top is the command used to get the list of running processes and resource utilization (RAM or CPU usage). It GIVES  all the information about each process running on the host :

  • Process ID (PID)
  • Owner of the process(USER)
  • Priority of process(PR)
  • Percentage of CPU (%CPU)
  • Percentage of memory
  • Total CPU TIME spends on the process.
  • Command used to start a process.

Sample Output :

PID USER      PR  NI  VIRT  RES SHR S %CPU %MEM    TIME+  COMMAND
7629 greys     20 0 749m 291m  28m S 1 7.4 16:51.40 firefox
19935 greys     20 0 133m 14m  10m S 0 0.4 2:38.52 smplayer
   1 root      20 0 4020  880 592 S 0  0.0 0:00.96 init
   2 root      15 -5 0    0 0 S 0 0.0   0:00.00 khutreadd
   3 root      RT -5 0    0 0 S 0 0.0   0:00.04 datamigration/0
   4 root      15 -5 0    0 0 S 0 0.0   0:00.90 ksoftirqd/0
   5 root      RT -5 0    0 0 S 0 0.0   0:00.00 watchdog/0
   6 root      RT -5 0    0 0 S 0 0.0   0:00.06 datamigration/1

Most commonly used options with the top  command are below –

top -u -> Process by a user. top – i -> exclude idle tasks top -p -> Show a particular process


Discussion

No Comment Found