Celeb Glow
general | March 19, 2026

How to kill a single thread from Terminal in Ubuntu?

I'm new to Ubuntu and new here. I need to know this.

How do I kill a single thread from Terminal in Ubuntu? I have mozilla opened and it has 45 threads. I want to kill one of it.

I've already search many sources online but to no avail. Can anyone help me?

2

3 Answers

You can't. Not without killing the whole process. From man 3 pthread_kill, a function used for signal handling:

NOTES Signal dispositions are process-wide: if a signal handler is installed, the handler will be invoked in the thread thread, but if the disposition of the signal is "stop", "continue", or "terminate", this action will affect the whole process.

Also see this U&L post.

5

This seems to be what tgkill is for, but it's unlikely the best way to deal with too many threads opened by application. It should be treated as a sort of debugging tool.

In terminal type:

kill -9 "pid number for the process"

For example:

kill -9 5624 (number 9 is the code for kill signal)

To get the PID number for the process either use:

ps -eLF

or you could use the command:

top

Every process will have it's own PID number. The reason for this is because processes can be named the same.

3

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy