Did your Telegram desktop application become unresponsive and refuse to close or reboot?

On Ubuntu, you can force quit the Telegram application by using the pkill command in your terminal.

If you don't already have a terminal window open, you can open one with the CTRL+ALT+T keyboard shortcut.

Then, execute this command in your terminal to kill all processes running Telegram on your machine:

      sudo pkill -9 Telegram

This command runs the pkill command with the -9 option, which is the SIGTERM signals used to tell a process to terminate.

After successfully running that command, all the instances of Telegram running on your machine should now be closed and terminated.

If you don't want to kill all the Telegram processes running on your machine, you can also kill individual processes. To do this, you need to first list out all the PIDs (Process Identifiers) running Telegram and then use the sudo kill -9 PID command to kill that specific process.

You can list all the processes running the Telegram with this command:

      ps aux | grep Telegram

The command uses ps aux to get all the processes running on your machine and then grep Telegram to filter out everything but processes running Telegram.

This will output something that looks like the following:

      nick      5334  6.2  0.5 1731888 94200 ?       Sl   23:16   0:00 /home/nick/Downloads/Telegram/Telegram --

The first number you see in the output after the username (5334 in the example output above) is the PID for that specific process.

You can also modify the output to only show the PID numbers:

      ps aux | grep Telegram | awk '{ print $2 }'

This output will look like this:


Now that you have the PID/s for the process running Telegram, you can end it with this command:

      sudo kill -9 PID

That will kill only the specific PID number you give to the command.

Thanks for reading!