# Kill A Process In Linux

To kill a process, first we need to know its process ID (PID), to do that we can use `pidof` command.

## Find PID of a Process

```bash
pidof {PROCESS_NAME}
```

## Kill a Process

```bash
kill {PROCESS_ID}
```

### Kill all the process with a program name

```bash
killall {PROGRAM_NAME}
```

### Using htop

We can also kill a process interactively using `htop` command.

**Reference(s)**

* [StackOverFlow](https://askubuntu.com/questions/104903/how-do-i-kill-processes-in-ubuntu)
* [Man7](https://man7.org/linux/man-pages/man1/htop.1.html)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://til.devjugal.com/linux/kill-a-process-in-linux.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
