PCã«ã·ãªã¢ã«ã³ã³ã½ã¼ã«ã§ãã°ã¤ã³ã§ããããã«è¨å®ãããã·ãªã¢ã«ã³ã³ã½ã¼ã«ã使ãã°NICã®è¨å®ãªã©ã§ãããã¦ãã«å©ç¨ã§ããã便å©ãã·ãªã¢ã«ã³ã³ã½ã¼ã«ã§ã¤ããmgetty mingettyã®ttyã£ã¦ãªãã ãã
ttyã¨ã¯ã
ã©ããããæ¨æºåºåã®æ¥ç¶å ããã¤ã¹äºã®ããããä¸è¬çã«ã¯ptsãRS232Cçµç±ãªã©ã¯ttyS0ãæ¨æºåºåã®æ¥ç¶å ã«ãªã£ã¦ãã¦ãä¸ç¶ãã¦ããããã°ã©ã ãmgettyã
å³ã§è¡¨ãã¨
PC----ssh------/dev/pts/1--sshd----bash #ssh ãæ¥ç¶ããã¦ãã PC----rs232c---/dev/ttyS0--mgetty--bash #rs232c ãæ¥ç¶ããã¦ãã
ã¨ttyãªã©ä»®æ³ç«¯æ«çµç±ã«ãªã£ã¦ãããã³ã¬ä»ã¯ãã解ã£ããã©ããã£ã¨ãã解ããªãã£ãã
ç§ãç解ã§ããããã«ãªãã¾ã§ã次ã®ããã»ã¹ãããã¾ããã
ï¼ã¶æåãå 輩ã«è¨ãã¦ã¿ã
俺ï¼tty ã¨ã mgetty ã¨ãããã¾ããã©ããããåããã¾ããã 大å 輩 : tty ãmgetty ãå¾ ã¡åãã¦ãã¦ttyçµç±ã§ãã°ã¤ã³ãããã ã
ã¾ãã¾ããããã¾ããã§ããã大å
輩ã¯ä½¿ã£ã¦ã¿ããããåãããã ãã©ã»ã»ã»ã¨è¡ã£ã¦ã¾ããã
ã°ã°ã£ã¦èª¿ã¹ã¦ã¿ã
ttyã¨ã¯
ããã転ãã¦ãTTYã¯ãRS-232Cãªã©ã®ã·ãªã¢ã«ã¤ã³ã¿ã¼ãã§ã¼ã¹ã§ã³ã³ãã¥ã¼ã¿ã¼ã«æ¥ç¶ããã³ã³ã½ã¼ã«å ¥åè£ ç½®ãæãããã«ãªã£ããç¾å¨ã§ã¯ã³ã³ã½ã¼ã«ãç¨ãããããã¨ããªããªã£ãããUNIXã®ä»®æ³çãªãã£ã©ã¯ã¿ã¼ç«¯æ«ã®ããã¤ã¹åã¨ãã¦ç¨ãããããªã©ã®å½¢ã§ä»ãåæ®ãã¨ã©ãã¦ããã
http://www.sophia-it.com/content/TTY
ã¾ãã¾ããã解ãã¾ããã§ããã
ã¯ã¦ãªè³ªåã§çºè¦ï¼ããã¦è§£æ±ºãã¾ãã
ã¡ãã£ã¨ãããã«ãã説æã«ãªã£ã¦ãã¾ãã¾ãããï¼ãã¨ãã°ï¼ãã¾èªåã使ã£ã¦ãã端æ«ãã©ããã表示ããã«ã¯ï¼
$ tty
ã¨å®è¡ãã¾ã
psコマンドの結果の、 TTYの項の、 tty2やpts/0はそれぞれどんな… - 人力検索はてな
ãªãã»ã©
æ©éãã£ã¦ã¿ã
å 輩ã試ãã°ããåããã®è¨èãæãåºãã¦ãã£ã¦ã¿ã¾ããã
ttyã確èªããã
takuya@v10:~$ tty /dev/pts/1
ã¨ãããã¨ã¯w /finger /who ã®ã³ãã³ãããè¦ããã¢ã¬ãtty
takuya@v10:~$ w USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT takuya pts/1 192.168.2.8:S.0 03:45 0.00s 0.50s 0.50s /bin/bash takuya pts/2 192.168.2.8:S.1 03:45 14:42 0.35s 0.35s /bin/bash
ããã¯
- takuya pts/1
- takuya pts/2
ã®ï¼ã»ãã·ã§ã³ã§ãã°ã¤ã³ãã¦ãã¾ããã¯ã¦ãªè³ªåã®ä¾ã®éããEchoãã¦éãã§ã¿ããã¨æãã¾ãã
åºåããå´
takuya@v10:~$ tty /dev/pts/1
ãããå´
takuya@v10:~$ tty /dev/pts/2
åºåãã¦ã¿ã
takuya@v10:~$ echo foooooobar > /dev/pts/2 takuya@v10:~$ echo foooooobar > /dev/pts/2
ããã
takuya@v10r:~$ foooooobar foooooobar
ããããã pts ã«åºåãããããã£ã¡å´ã«åºåã§ãããã³ã¬ã¯é¢ç½ãã§ããã
ä½ã®å½¹ã«ãç«ããªãããã©é¢ç½ãã§ããã
ãã®å®é¨ã§ãttyã¯ä»®æ³ãã¡ã¤ã«ã§åºå ¥åãæ±ãããã¤ã¹ã ã¨ããããªä½é¨ãã¾ããã
write / wall ã³ãã³ã
write ã³ãã³ã㨠wall ã³ãã³ãã§ãtty ã«éä¿¡ãããã¨ãåºæ¥ã¦ãè¤æ°äººã§ããã«ããã¨æ¥½ããã
2011/11/11追è¨
tty ã¨ãpts㯠ttyããã¼ãã¼ãã¨åºåãPTS㯠ttysã®ä»®æ³åãæ¬ä¼¼TTY
ãã¼ãã¼ãã¯æ¨æºå
¥å
2016-02-24追å
ã¦ã¤ã³ãã¦ãºã§ä¾ããã»ããåããããããã
- bash = cmd.exe
- tty = conhost.exe
2017-01-24
write/ wall ã«ã¤ãã¦è¿½è¨