lk/basics/kill.md

75 lines
1.5 KiB
Markdown
Raw Permalink Normal View History

2022-01-16 18:20:39 +00:00
---
title: "kill"
2022-01-26 21:29:48 +00:00
tags: [ "Documentation", "Basics" ]
2022-01-16 18:20:39 +00:00
---
2021-05-15 14:41:45 +00:00
2022-01-26 21:29:48 +00:00
If you want to kill a program in a graphical environment, open a terminal and type:
# Graphical Programs
2021-05-15 14:41:45 +00:00
```bash
xkill
```
2021-05-15 14:41:45 +00:00
Then click on the application which you want to kill.
2022-01-26 21:29:48 +00:00
# All Programs
2021-05-15 14:41:45 +00:00
To kill a program, find it with:
```bash
pgrep discord
```
2021-05-15 14:41:45 +00:00
This will give you the UUID, e.g. `19643`.
Kill the program with:
```bash
kill 19643
```
2021-05-15 14:41:45 +00:00
2022-01-26 21:29:48 +00:00
# Types of Kill
2020-01-02 00:04:35 +00:00
To see an ordered list of termination signals:
```bash
kill -l
```
2020-01-02 00:04:35 +00:00
> 1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL 5) SIGTRAP
> 6) SIGABRT 7) SIGBUS 8) SIGFPE 9) SIGKILL 10) SIGUSR1
> 11) SIGSEGV 12) SIGUSR2 13) SIGPIPE 14) SIGALRM 15) SIGTERM
2020-01-02 00:04:35 +00:00
2021-05-15 14:41:45 +00:00
You can select these levels with a '- number'.
Higher numbers are roughly equivalent to insistence.
For example:
```bash
kill -1 3498
```
2021-05-15 14:41:45 +00:00
This roughly means 'maybe stop the program, if you can, maybe reload'.
Or the famous:
```bash
kill -9 3298
```
2021-05-15 14:41:45 +00:00
This means 'kill the program dead, now, no questions, dead'.
**Beware** - if Firefox starts another program to connect to the internet, and you `kill -9 firefox`, this will leave all of Firefox's internet connection programs ("children") still there, but dead and useless.
# Sobriquets
2021-05-15 14:41:45 +00:00
- A dead program which sits there doing nothing is known as a 'zombie'.
- A program which is run by another program is called a 'child program'.
- A child whose parent program is dead is called an 'orphan'.
- A child who remains running despite being useless because the parent is dead is called an 'orphan zombie'.