--- layout: default title: usr/share/doc/sysbox/html/tool/taskkill.html --- Sysbox: taskkill

Sysbox: taskkill

Usage: taskkill [OPTION]... PROCNAME...
or: taskkill -P [OPTION]... TASKHANDLE...

Kill a task (aka. process) by handle or name. Can be invoked only from elevated shells (or tasks).

Options:

Notes to the example:

  1. Spawn a sleep with a large timeout. Enough (more than a day), to type our subsequent commands.
  2. Print the task table. (The output was cut, to spare some space.)
  3. Invoke the taskkill tool to delete our sleep process. The tool will print all the task handles that will be killed.
  4. The second taskkill invocation use the -P option, and task handle was passed instead of task name.

Examples (Important! Only super tasks can perform these):

# sleep 100000 &
#
# task -n
              Handle  Pri  Th  Sl_u  Sl_p   Mo     Alloc  Reserved  Name
  0x0000000001000008^   0   1     3     6    0        0k        0k
  0x0000000001000019^  31   1   719   865   97      688k      704k  registry
...
  0x0000000009001ACC^  10   1   152   152   10      292k      516k  sleep
  0x000000000E001C05^  10   1   152   152   10      216k      352k  task

               Total       59  7454  7455 1099    65200k    81832k
                Free                                      3432244k
                  43 tasks.

#
# taskkill sleep
Deleting task 0x0000000009001acc ... done.
#
# sleep 100000 &
#
# task -n
              Handle  Pri  Th  Sl_u  Sl_p   Mo     Alloc  Reserved  Name
  0x0000000001000008^   0   1     3     6    0        0k        0k
  0x0000000001000019^  31   1   719   865   97      688k      704k  registry
...
  0x000000000F001ACC^  10   1   152   152   10      292k      516k  sleep
  0x0000000012001C05^  10   1   152   152   10      216k      352k  task

               Total       59  7454  7455 1099    65276k    81832k
                Free                                      3432244k
                  43 tasks.

#
# taskkill -P 0x000000000F001ACC
Deleting task 0x000000000f001acc ... done.
#