View and close the terminal __linux that is logged on to Linux

Source: Internet
Author: User

Basic concepts:

TTY (general designation of terminal equipment):
The word TTY originated from teletypes, originally refers to the telex, is through the serial line with the printer keyboard to read and send information, and later this thing was replaced by keyboard and monitor, so now called terminal is more appropriate.
A terminal is a character-type device, usually used as a TTY to refer to various types of terminal equipment.
Pty(virtual terminal):
Remote Telnet to the host does not also require a terminal interaction. Yes, this is Virtual Terminal pty (Pseudo-tty)
Virtual terminal is a pair of logical terminal equipment, including master and slave devices.

pts (pseudo-terminal slave) is a way to implement Pty, and PTMX (Pseudo-terminal Master) is implemented in conjunction with the implementation pty

Serial port terminal (/dev/ttysn)
Terminal equipment connected using a computer serial port, corresponding device name similar to/DEV/TTYS0 (or/dev/tts/0),/dev/ttys1 (or/DEV/TTS/1), etc.


When you log on to the Linux system through Ssh,telnet, you will generate a device that PTS represents a virtual terminal.

Or a serial port connection, it is/dev/ttysn such as terminal equipment.

The following are commonly used commands:

1. List the users currently logged on to the system

W.H.O.

root@ubuntu:/# who
root     pts/0       2017-03-01 09:51 (192.168.3.151)
root     pts/1       2017-03-01 18:27 (192.168.3.129)
Root     pts/2       2017-03-01 18:27 (192.168.3.144)
root     pts/3       2017-03-01 18:27 (192.168.3.151)

2. Close a user who is logged on to the system

Fuser-k/dev/pts/User ID

root@ubuntu:/# fuser-k/dev/pts/3
/dev/pts/3:          9339
3. View the currently logged-on user

Tty

root@ubuntu:/# TTY
/DEV/PTS/1

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.