how to kill the tty in unix

前端 未结 10 1502
遇见更好的自我
遇见更好的自我 2020-12-23 20:52

This is the result of the finger command (Today(Monday) when I (Vidya) logged in)

sekic1083 [6:14am] [/home/vidya] -> finger
Name        Tty          


        
10条回答
  •  情话喂你
    2020-12-23 21:38

    You can run:

    ps -ft pts/6 -t pts/9 -t pts/10
    

    This would produce an output similar to:

    UID        PID  PPID  C STIME TTY          TIME CMD
    Vidya      772  2701  0 15:26 pts/6    00:00:00 bash
    Vidya      773  2701  0 16:26 pts/9    00:00:00 bash
    Vidya      774  2701  0 17:26 pts/10   00:00:00 bash
    

    Grab the PID from the result.

    Use the PIDs to kill the processes:

    kill    ...
    

    For the above example:

    kill 772 773 774
    

    If the process doesn't gracefully terminate, just as a last option you can forcefully kill by sending a SIGKILL

    kill -9 
    

提交回复
热议问题