Have you ever come across a miss-behaving process? In this post I will share how you can keep your system under control effectively.
If we don’t know the name of the process a good start is getting a list of running process. You may turn to top, but I want to propose a better looking tool: htop
Using htop for linux process managament
With htop you get a quick and clean overview of you current system status. You can customize it (color scheme, columns…) by opening the setup (F2), and you can also sort the columns by clicking on the column header.
Another way to visualize your process list is via a process tree. You can either press F5 in htop to enable tree display or use a command like pstree, but my personal favourite is ps axf.
If you already know what you are looking for ( firefox hang maybe?
) the usual approach is greping out the process name from ps, but that’s not as good as it could be, specially because there is already a tool to do exactly this, know by the name of pgrep.
Using pgrep without flags will only get you the PID, which can be useful for scripting, but what some people don’t know is that you can also get the full command line using the -lf flag.
Now it’s time to get rid of those pesky processes. You can either use kill <pid>, killall <name> or pkill <name>, you can also kill a process directly from htop.
I hope that helps you tame your system and have a better experience while using Linux, thanks for passing by!


