Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Use the tty command in linux to print out the terminal file name connected to standard input

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Editor to share with you the use of linux tty command printout connected to the standard input of the terminal file name, I believe that most people do not know much, so share this article for you to learn, I hope you will learn a lot after reading this article, let's go to learn the method!

Tty is the abbreviation of Teletype (teletypewriter). Teletypewriter is one of the earliest terminal devices. now TTY is usually used to refer to various types of terminal devices, such as keyboards, printers, monitors and so on.

Pty (virtual terminal): if we remotely telnet to the host or use xterm, we also need a terminal interaction, which is the virtual terminal pty (pseudo-tty).

Pts/ptmx (pts/ptmx is used in conjunction with pty): pts (pseudo-terminal slave) is the implementation method of pty, and it is used with ptmx (pseudo-terminal master) to implement pty.

Syntax format: tty [parameters]

Common parameters:

-s/--silent/--quiet has no printout result, but only returns exit status code-- help printout tty command help and exit-- version printout current tty command version information

Reference example

Enter the tty command directly and print the file name of the terminal device connected to the current standard input:

[root@linuxcool ~] # tty/dev/pts/1

Enter tty-s/--silent/--quiet to return no direct result, you need to use # echo $? View the returned exit code:

[root@linuxcool ~] # tty-s [root@linuxcool ~] # echo $? 0 is all the contents of the terminal file name connected to the standard input using the tty command in linux. Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report