When I try who
, I frequently see output such as this:
username pts/0 2015-10-09 04:48 (mosh [2680])
username pts/2 2015-10-12 00:04 (75.139.11.119 via mosh [12364])
username pts/6 2015-10-12 00:10 (75.139.11.119 via mosh [9728])
Where my username is logged into several sessions. Unfortunately I do not know which one I am currently using. Is there a way to tell so that if I kill
the mosh PID
, I don't kill my own session?
Best Answer
The
tty
command will tell you which pseudo-terminal session you are running. And that can distinguish which line is yours.