Viewing terminal information
In this recipe, we'll learn more about what TTYs and PTYs are and how to read their attributes and information. This will help us in our understanding of TTYs as we move forward in the chapter. Here, we learn how to find out which TTY or PTY we are using, where it lives on the filesystem, and how to read its attributes.
There are no special requirements for this recipe. We'll only use standard programs that are already installed.
How to do it…
In this recipe, we'll explore how to find your own TTY, what attributes it has, where its corresponding file lives, and what kind of TTY it is:
- Start by typing
ttyin your terminal. This will tell you which TTY you are using on the system. There can be many TTYs and PTYs on a single system. Each of them is represented by a file on the system:
$> tty /dev/pts/24
- Now, let's examine that file. As we see here, it's a special file type, called character...