2022-02-14 03:22:51 +01:00
|
|
|
---
|
|
|
|
title: kill
|
|
|
|
layout: command
|
|
|
|
version: 0.59.0
|
|
|
|
---
|
|
|
|
|
2021-05-30 02:57:04 +02:00
|
|
|
Kill a process using the process id.
|
|
|
|
|
2022-02-14 03:22:51 +01:00
|
|
|
## Signature
|
|
|
|
|
|
|
|
```> kill (pid) ...rest --force --quiet --signal```
|
2021-05-30 02:57:04 +02:00
|
|
|
|
|
|
|
## Parameters
|
|
|
|
|
2022-02-14 03:22:51 +01:00
|
|
|
- `pid`: process id of process that is to be killed
|
|
|
|
- `...rest`: rest of processes to kill
|
|
|
|
- `--force`: forcefully kill the process
|
|
|
|
- `--quiet`: won't print anything to the console
|
|
|
|
- `--signal {int}`: signal decimal number to be sent instead of the default 15 (unsupported on Windows)
|
2021-05-30 02:57:04 +02:00
|
|
|
|
|
|
|
## Examples
|
2022-02-14 03:22:51 +01:00
|
|
|
|
|
|
|
Kill the pid using the most memory
|
2021-05-30 02:57:04 +02:00
|
|
|
```shell
|
2022-02-14 03:22:51 +01:00
|
|
|
> ps | sort-by mem | last | kill $in.pid
|
|
|
|
```
|
2021-05-30 02:57:04 +02:00
|
|
|
|
2022-02-14 03:22:51 +01:00
|
|
|
Force kill a given pid
|
2021-05-30 02:57:04 +02:00
|
|
|
```shell
|
|
|
|
> kill --force 12345
|
2022-02-14 03:22:51 +01:00
|
|
|
```
|
2021-05-30 02:57:04 +02:00
|
|
|
|
2022-02-14 03:22:51 +01:00
|
|
|
Send INT signal
|
2021-05-30 02:57:04 +02:00
|
|
|
```shell
|
|
|
|
> kill -s 2 12345
|
2022-02-14 03:22:51 +01:00
|
|
|
```
|