When I consecutively issue multiple commands which create a new shell, e.g.
zsh screen su user2 mc sudo su mc
Is there a command to show the “call stack”, i.e. a list of the commands which have not finished but created a new shell?
I might have issued some other commands among them, so the shell history won’t help. Moreover, I might have switched users and shells as shown in the above example.
I know I can find this information using the tree view in
htop but can I get it directly using a command?