Stopping unresponsive programs in Ubuntu

This is a simple problem, with a simple solution. Which I will forget. Hence the post.

The following command will list all running applications on a Linux system. The first two columns are the user running the application, and the applications program id or “pid”.

ps aux

Example output

USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root           1  0.3  0.0 168444 12104 ?        Ss   14:31   0:03 /sbin/init splash
root           2  0.0  0.0      0     0 ?        S    14:31   0:00 [kthreadd]
root           3  0.0  0.0      0     0 ?        I<   14:31   0:00 [rcu_gp]
root           4  0.0  0.0      0     0 ?        I<   14:31   0:00 [rcu_par_gp]

However, it would be ideal to search for a specific application, which we can do by piping the results through “search” using grep.

ps aux | grep nameofprogram

This will list all programs running that include nameofprogram. We can then use the pid to stop it.

kill -9 pid

Posted

in

by

Tags:

Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: