Linuxtty command learning

Source: Internet
Author: User
About the linuxtty command, the tty command is used to print the name of the terminal connected to the standard input. if devconsole is displayed, the terminal is the console terminal. if devptsn is displayed, this terminal is a virtual terminal (Terminal that remotely connects to linuxserver ). Run the linux tty command to learn how to use the tty command to print the name of the terminal connected to the standard input. if/dev/console is displayed, this terminal is a console terminal; if/dev/pts/n is displayed, this terminal is a virtual terminal (Terminal remotely connected to the linux server ). Check that the return code for tty command execution is 0 and that the standard input is a terminal. Sh-# tty/dev/consolesh-# echo $? 0sh-# tty/dev/pts/6 through the following command, we know that/dev/console is a character device (linux treats almost all devices as files ), sh-# ls-l/dev/consolecrw-r -- 1 root 5, 1 Jan 1/dev/console
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.