文章目录
1.命令简介
tty(teletypewriter)显示出连接到当前标准输入的终端设备文件名。
2.命令格式

tty [OPTION]...

3.选项说明
linux系统命令topfree的使用及参数详解_linux route命令详解_linux netstat 命令详解

-s, --silent, --quiet 什么也不显示,只返回退出状态值。 --help 显示帮助信息。 --version 显示版本信息。

4.返回值
当使用 -s, --silent, --quiet 时,返回码为 0 表示标准输入是终端,返回码为 1 表示标准输入不是终端,返回码为 2 表示选项错误,返回码为 3 表示有写错误发生。
5.常用示例
(1)显示当前终端设备文件名。

tty /dev/pts/1

linux route命令详解_linux netstat 命令详解_linux系统命令topfree的使用及参数详解
(2)什么也不显示linux系统命令topfree的使用及参数详解linux系统命令topfree的使用及参数详解redhat linux 9.0linux软件下载,只返回退出状态值。

tty -s echo $? 0

(3)显示帮助信息。

tty --help Usage: tty [OPTION]... Print the file name of the terminal connected to standard input. -s, --silent, --quiet print nothing, only return an exit status --help display this help and exit --version output version information and exit linux route命令详解_linux系统命令topfree的使用及参数详解_linux netstat 命令详解 GNU coreutils online help: For complete documentation, run: info coreutils 'tty invocation'

参考文献
tty(1) -- Linux manual page --
tty(1p) -- Linux manual page --
GNU coreutils online help