There are a number of programs that you can use to view running processes in Linux, and generally every desktop environment will include one of their own. GNOME for example comes with GNOME System Monitor while KDE has System Activity. For all Linux distributions however, you can use always go to the command line and use both ps and top.

1) ps

To view processes using ps, issue the following command in the console;

$ ps aux

The given options are for the following;

  • a → all users
  • u → show the owner/user
  • x → all processes

The output of the command would be something like the following

USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0   2800  1644 ?        Ss   Jul14   0:00 /sbin/init
root         2  0.0  0.0      0     0 ?        S    Jul14   0:00 [kthreadd]
root         3  0.0  0.0      0     0 ?        S    Jul14   0:00 [migration/0]
root         4  0.0  0.0      0     0 ?        S    Jul14   0:42 [ksoftirqd/0]
root         5  0.0  0.0      0     0 ?        S    Jul14   0:00 [watchdog/0]
......
mysql      866  0.0  1.0 145944 21144 ?        Ssl  Jul14   0:28 /usr/sbin/mysqld
......
www-data  5017  0.0  0.5  39364 11968 ?        S    10:25   0:00 /usr/sbin/apache2 -k start
www-data  5018  0.0  0.5  39364 11964 ?        S    10:25   0:00 /usr/sbin/apache2 -k start
www-data  5019  0.0  0.7  42628 15088 ?        S    10:25   0:00 /usr/sbin/apache2 -k start

2) top

top is an almost a realtime replacement for ps, where the program will update the process listing periodically. The following is a sample output of the program top.

top - 16:57:44 up 1 day,  4:03,  4 users,  load average: 0.47, 0.46, 0.51
Tasks: 193 total,   2 running, 190 sleeping,   1 stopped,   0 zombie
%Cpu(s):  6.2 us,  1.3 sy,  0.0 ni, 92.3 id,  0.2 wa,  0.0 hi,  0.1 si,  0.0 st
KiB Mem:   8166884 total,  7558992 used,   607892 free,   658196 buffers
KiB Swap:        0 total,        0 used,        0 free,  3992436 cached

  PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+  COMMAND                                                                                                                                                                                                          
21772 user    20   0 1094m  55m  28m S  11.3  0.7   8:30.20 vlc                                                                                                                                                                                                              
 1302 root      20   0  299m  97m  41m S   4.3  1.2  33:17.04 Xorg                                                                                                                                                                                                             
 2455 user    20   0  470m 7460 5176 S   3.0  0.1  10:23.83 pulseaudio                                                                                                                                                                                                       
 2396 user    20   0  737m  85m  39m S   2.3  1.1  11:27.00 kwin                                                                                                                                                                                                             
18313 user    20   0  469m  33m  23m S   2.0  0.4   0:10.75 konsole                                                                                                                                                                                                          
 2890 user    20   0 1170m 272m  40m S   1.7  3.4  49:07.62 firefox                                                                                                                                                                                                          
 3246 user    20   0 1256m 197m  33m S   1.0  2.5  47:49.23 chromium-browse                                                                                                                                                                                                  
 1237 mysql     20   0  603m  74m 7248 S   0.3  0.9   1:23.35 mysqld                                                                                                                                                                                                           
 2875 user    20   0  886m 215m  48m S   0.3  2.7  29:42.07 chromium-browse                                                                                                                                                                                                  
22218 user    20   0  900m  74m  19m S   0.3  0.9   0:04.94 chromium-browse                                                                                                                                                                                                  
23732 user    20   0 20624 1728 1160 R   0.3  0.0   0:00.02 top                                                                                                                                                                                                              
    1 root      20   0 24604 2552 1400 S   0.0  0.0   0:00.97 init                                                                                                                                                                                                             
    2 root      20   0     0    0    0 S   0.0  0.0   0:00.02 kthreadd                                                                                                                                                                                                         
    3 root      20   0     0    0    0 S   0.0  0.0   1:42.97 ksoftirqd/0                                                                                                                                                                                                      
    6 root      rt   0     0    0    0 S   0.0  0.0   0:03.03 migration/0                                                                                                                                                                                                      
    7 root      rt   0     0    0    0 S   0.0  0.0   0:00.36 watchdog/0                                                                                                                                                                                                       
   20 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 cpuset                                                                                                                                                                                                           
   21 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 khelper                                                                                                                                                                                                          
   22 root      20   0     0    0    0 S   0.0  0.0   0:00.00 kdevtmpfs                                                                                                                                                                                                        
   23 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 netns                                                                                                                                                                                                            
   25 root      20   0     0    0    0 S   0.0  0.0   0:00.54 sync_supers                                                                                                                                                                                                      
   26 root      20   0     0    0    0 S   0.0  0.0   0:00.01 bdi-default                                                                                                                                                                                                      
   27 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 kintegrityd                                                                                                                                                                                                      
   28 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 kblockd                                                                                                                                                                                                          
   30 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 ata_sff                                                                                                                                                                                                          
   31 root      20   0     0    0    0 S   0.0  0.0   0:00.04 khubd                                                                                                                                                                                                            
   32 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 md                                                                                                                                                                                                               
   35 root      20   0     0    0    0 S   0.0  0.0   0:00.07 khungtaskd                                                                                                                                                                                                       
   36 root      20   0     0    0    0 S   0.0  0.0   0:01.07 kswapd0                                                                                                                                                                                                          
   37 root      25   5     0    0    0 S   0.0  0.0   0:00.00 ksmd                                                                                                                                                                                                             
   38 root      39  19     0    0    0 S   0.0  0.0   0:00.00 khugepaged                                                                                                                                                                                                       
   39 root      20   0     0    0    0 S   0.0  0.0   0:00.06 fsnotify_mark                                                                                                                                                                                                    
   40 root      20   0     0    0    0 S   0.0  0.0   0:00.00 ecryptfs-kthrea                                                                                                                                                                                                  
Leave your feedback:
Share!