LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   Terminal Questions? "cat /dev/tty1" Why Not? (https://www.linuxquestions.org/questions/linux-security-4/terminal-questions-cat-dev-tty1-why-not-294963/)

chris318 02-25-2005 08:47 PM

Terminal Questions? "cat /dev/tty1" Why Not?
 
How come I can echo a tty device by doing "echo hello > /dev/tty1", but I can't cat a tty device? If I try to do a "cat /dev/tty1" in tty2 for example I don't see the output of tty1. I'm doing this as root by the way. I can see how this may be a security thing but root should be able to do anything?

Lets say I log into X from tty1 using startx. I then go into an X session. Now I go to tty2 and type startx -- :1 and start anothr X session. alt F7 and alt F8 are my X session. What is the equivalent tty devices created on F7 and F8?

Now while I'm in X I start up xterm. The device now is /dev/pts/1. What type of terminal is this and what relation does it have to the reguler tty's?

While I'm in xterm I would like to see the logging output of X and the window manager going to tty1. How come "cat /dev/tty1" doesn't give the desired results? How can I redirct all output going to tty1 to /dev/pts/1?

I know I can "startx > xlog 2>&1" and then go to any terminal and do a "tail xlog" but this is not what i'm looking for. This is not really what I'm looking for.

Doesn't all input and output of a terminal go throught the tty device? So shouldn't cat tty just show you everything going in and out?

Matir 02-25-2005 09:57 PM

With your question about X, X sessions have no associated PTY. They are not terminal devices. You can't "cat" a tty because it's already being read by the terminal manager.


All times are GMT -5. The time now is 04:37 AM.