Teletypewriter
전신 인자기(電信印字機), 또는 텔레타이프라이터(teletypewriter 또는 TTY)는 일대일, 일대다 통신에서 사용된 전기식 타자기로, 간단한 선줄 연결부터 라디오나 마이크로파를 이용한 통신에 이르기까지 여러 통신 경로에서 광범위하게 사용되었다. 이외에도 초기의 메인프레임이나 미니컴퓨터에서 컴퓨터로 타자된 데이터를 전송하고 컴퓨터의 반응을 출력하며 명령 줄 인터페이스 구실을 하기도 했다. (현대 유닉스 계열 시스템에서 터미널을 가리키는 용어로 여전히 TTY가 사용된다)
Linux
리눅스 tty (TeleTYpewriter; TTY) 리눅스 텔레타이프라이터, 원격타자기.
- 리눅스 터미널, 콘솔
- 터미널 확인 리눅스 명령어
- 터미널 이름을 출력하는 리눅스 명령어
- 표준입력에 접속된 터미널 장치 파일명 출력
tty command-line tool
사용자의 터미널 이름을 반환한다.
/dev/tty vs /dev/console
From the documentation:
-
/dev/tty
: Current TTY device -
/dev/console
: System console -
/dev/tty0
: Current virtual console
아래와 같은 차이점이 있다.
-
/dev/console
is a virtual set of devices which can be set as a parameter at boot time. It might be redirected to a serial device or a virtual console and by default points to/dev/tty0
. When multipleconsole=
options are passed to the kernel, the console output will go to more than one device. -
/dev/tty0
is the current virtual console -
/dev/tty[1-x]
is one of the virtual consoles you switch to withcontrol-alt-F1
and so on. -
/dev/tty
is the console used by the process querying it. Unlike the other devices, you do not need root privileges to write to it. Note also that processes like the ones launched by cron and similar batch processes have no usable/dev/tty
, as they aren't associated with any. These processes have a?
in theTTY
column ofps -ef
output.
Troubleshooting
Ubuntu 에서 /dev/ttyUSB0 연결이 저절로 끊기는 현상
Universal Serial Bus#Ubuntu 에서 /dev/ttyUSB0 연결이 저절로 끊기는 현상 항목 참조. 간단히, sudo apt purge brltty
로 brltty를 제거하면 된다.
See also
- stty
- Bash
- xterm.js
- terminfo
- ANSI escape code (Terminal Control Escape Sequences)
- Software flow control
Favorite site
- KLDP: /dev/tty 가 뭐죠?
- 리눅스/유닉스: 터미널, tty, 콘솔, 그리고 쉘에 대하여
- Zetawiki - /dev/tty
- Zetawiki - 리눅스 tty
- Zetawiki - /dev/pts/0
- Wikipedia (en) Teletypewriter
- TTY - Bash Shell Script 1
References
-
BASH_shell-script.pdf ↩