tty

Format:

tty 

Use tty to report what device or terminal you are connected to.

					$ tty 
/dev/tty08
				

Use tty -s to determine if your script is interactive. The return codes are:

0 for a terminal
1 for a non-terminal

Get Linux and Unix Shell Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.