|
|
16 Dec 2007 12:44:18 pm |
Console, tty and ps |
|
|
The difference between console and tty in Unix could be dscribed at http://uwsg.iu.edu/UAU/navigate/tty.html, that is console is the monitor and the keyboard connect to the host with a device of normally /dev/console, while tty is the terminal, ssh or telnet client which map to /dev/ttyp0 , ttyp1, ttyp2. tty means Ternimal Type.
To know how many active tty are active, use ps -a. To send a message to other tty like ttyp3, you can
$ echo "you message" > ttyp3
Other command like write, talk, mesg, wall are using in other unix system.
ps -vx and ps -ux can display all the process currently running and it's status. To kill any process just kill [PID], so I guess it can kill tty user and kick them out from the system.
console和tty的区别可以参考http://uwsg.iu.edu/UAU/navigate/tty.html, console就是接在主机上的键盘与显示器对应于/dec/console,而tty可以是terminal,ssh或telnet的客户端,他们对应/dev/ttyp0,ttyp1,ttyp2等, tty代表Terminal Type.
想要知道当前有多少tty正在接入,用ps -a指令, 向另一个tty发消息可以
$ echo "you message" > ttyp3
其他指令有write, talk, mesg, wall .
ps -vx 和 ps -ux 可以显示当前所有process,杀进程就kill [进程号],所以要踢tty用户,可以考虑kill. |
|
| |
Category : IPhone
| Posted By : Eric Shan | Comments [0] | Trackbacks [0] |
|
|
| The URI to TrackBack this entry is : http://blog.tntsoft.com/trackback.php/14 | |
|
|
|
|