Someone had spawned a while true loop in bash (logged in as root) on a server. It kept spawning processes, which fortunately exited but I needed to kill the parent. I came to know it was spawned directly from command line and not from a script, so I grepped for '-bash' and killed those processes owned by root. It worked fine.
When you do ps aux
, In the command column different variants of bash show up.
/bin/bash
-bash
-bash
-bash
/bin/bash
bash
/bin/bash
/bin/bash
bash
etc..
What are the differences?
-bash
and/bin/bash
is, not what the difference between a login shell and non-login shell is. The answer to this question is, "-bash
denotes a login shell and/bin/bash
denotes a non-login shell." The answer to the other question is a list of differences between login shells and non-login shells. – Jul 06 '13 at 02:33