Vous êtes ici : Accueil / FAQs / How to kill a process?

How to kill a process?




Find the Process ID (PID)

The active processes on a machine are listed with the command:

ps -ef

The list contains in the first column the name of the owner and in the second column the process identification number. (PID). Example:

glslogin1> ps -ef
UID        PID  PPID  C STIME TTY          TIME CMD
root         1     0  0 Apr30 ?        00:00:41 /sbin/init splash
...

A more precise selection is done with the unix command "grep".. Example:

glslogin1> ps -ef | grep albert
albert   1733  1730  0   Dec 09 pts/7    0:02 /usr/local/bin/tcsh
...




Kill the Process

A process can only be killed if it belongs to you...

If you own the process, you can kill it with the command:

kill -9 <PID> [...] 

Example

glslogin1> kill -9 1733 

If he doesn't belong to you and it's essential that he be killed you must:

  • either have this process killed by someone with Super User privileges. (root).
  • or reboot the computer on which this process is running.

 

Use T_reboot_lcu, T_reboot_servers, T_reboot_master commands to easily reboot machines.

 




Use of "top"

Note: the "top" command displays the processes consuming the most CPUs (sorted in descending order of consumption).

Once launched you can (esc will abort the current action) type:

  • h to get help
  • n<n><return> to change the number of processes displayed
  • k<pid><return>9<return> to kill a process
  • q to quit
  • ...

 


LW 11/05/2020