How to kill a unresponsive program from terminal?

Solution 1:

You should be able to use:

pkill totem

A generally helpful thing to find which processes are hogging the CPU is top: top screenshot then you can press k and type in the PID of the process, and then press Enter twice to kill it;

Another program that can do this is htop: htop screenshot This can also system resources being used, and processes can be killed by selecting them, pressing k, and then pressing Enter. Parent processes can also be found by pressing t to toggle tree view.

Solution 2:

Easiest method:

killall totem

As is says: this will kill -all- instances named totem.

Alternative:

ps -ef |grep totem
rinzwind  3601  2236 14 21:05 ?        00:00:00 totem

and then kill the process

kill -9 3601

If totem is started as another user you will need sudo.

Solution 3:

You can also use pstree -ps command to get a complete (tree-)list of running processes with sub-processes, like this:

    ├─mission-control(1689)  
    ├─modem-manager(912)  
    ├─mpd(1908)─┬─{mpd}(1909)  
    │           ├─{mpd}(1910)  
    │           ├─{mpd}(1911)  
    │           ├─{mpd}(1912)  
    │           └─{mpd}(1913)  
    ├─nmbd(1858)  
    ├─obex-data-serve(1652)

Then use terminals' search function cmd+shift+f to seek out the process in question, for instance; mpd followed by this command:

kill -9 1908