When I press Ctrl + Alt + F(1-6), I'm directed to virtual terminal. I've two user account except guest. When I try to login from one of those two users, my system gets hang. So, I was wondering how to restart that virtual console from another virtual console or how to kill all processes in one virtual console from another virtual console.
Asked
Active
Viewed 3,420 times
2 Answers
5
If you have sufficient privileges, you can use pkill with the -t switch to kill all processes on a particular terminal device e.g. to kill all processes under the Ctrl+Alt+F2 virtual terminal (whose device is /dev/tty2)
sudo pkill -t tty2
See man pkill for additional options
steeldriver
- 136,215
- 21
- 243
- 336
3
Run in terminal
ps -ft tty2
Output will be look like:
UID PID PPID C STIME TTY TIME CMD
root 1024 1 0 06:52 tty2 00:00:00 /bin/login --
gulu 3532 1024 0 09:15 tty2 00:00:00 -bash
Here I am going to kill Virtual Console 2 (tty2). Just kill the pid of /bin/login -- with root privilege
kill -9 <pid>
here,
kill -9 1024
sourav c.
- 44,715