---
layout: default
title: usr/share/doc/sysbox/html/tool/taskkill.html
---
Sysbox: taskkill
or: taskkill -P [OPTION]... TASKHANDLE...
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:
- -a
Kill all task with the given name. Works only when PROCNAMEs are supplied. By default, taskkill will stop when the given name is found. But with this option, all matching tasks will be killed. - -P
Use task handles instead of task names. Use the 0x prefix to indicate hexadecimal handles.
Notes to the example:
- Spawn a sleep with a large timeout. Enough (more than a day), to type our subsequent commands.
- Print the task table. (The output
was cut, to spare some space.)
- Invoke the taskkill tool to delete our sleep process. The tool will print all the task handles that will be killed.
- 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. #