LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   difference between tty and pts (https://www.linuxquestions.org/questions/linux-newbie-8/difference-between-tty-and-pts-795928/)

_Linux_Learner 03-16-2010 11:13 PM

difference between tty and pts
 
What is the difference between /dev/tty and /dev/pts ??
I google a lot but didn't understand......

Thanks in advance

freelinuxtutorials 03-16-2010 11:45 PM

/dev/pts --> it shows that you are in virtual terminal, when you ssh a server remotely..it is in pts

/dev/tty --> if it's in true tty

MrCode 03-16-2010 11:51 PM

Quote:

when you ssh a server remotely..it is in pts
It's also a /dev/ptsn when you're in an X terminal.

If you want to know what terminal you're on, you can use the tty command. ;)

raju.mopidevi 03-17-2010 04:32 AM

tty = hardwired terminal on a serial connection.
pts (a/k/a pty) is a pseudo-tty to emulate terminals on network connections.

_Linux_Learner 03-18-2010 08:02 AM

Not Clear
 
These answer are quite confusing. Is tty some software or hardware component ?????

using who command gives the following output...
Code:

_Linux_Learner tty7        2010-03-18 17:32 (:0)
_Linux_Learner pts/0        2010-03-18 18:10 (:0.0)

what this tty7 shows ?? In the /dev directory there are more tty1,tty2...... and ttys1,ttys2 etc ....

Please elaborate.

Thanks in advance

catkin 03-18-2010 11:21 AM

Quote:

Originally Posted by _Linux_Learner (Post 3903132)
These answer are quite confusing. Is tty some software or hardware component ?????

"tty"s are device files that were originally used when accessing actual hardware terminals but are now more commonly used for accessing virtual terminals, the ones you get by Alt+Tab+F<n> where n is typically 1-6. In case a historical perspective helps, the name is short for teletype which is the sort of device people used for accessing computers before the price and size of memory chips made cathode ray tube screens affordable (they needed a massive 1kB capacity!)

"pty"s are pseudo "tty"s that are not associated with actual hardware, as used by "terminal emulator" software such as X's xterm and Windows' HyperTerm.

catkin 03-18-2010 11:28 AM

Quote:

Originally Posted by _Linux_Learner (Post 3903132)
what this tty7 shows ??

tty7 is virtual terminal 7, where the system displays the graphical logon prompt and, after logon, the desktop. If you are displaying one of the other virtual terminals (via Ctrl+Alt+F<n> where n is 1 to 6) then you can get back to virtual terminal 7. Typically the system starts one of the graphical display managers (gdm, kdm or xdm) on tty7 during boot and switches the display to it. Many people never leave it so do not see the other virtual terminals until shutdown when tty0 (the console) is displayed again.

_Linux_Learner 03-18-2010 12:44 PM

Got Something
 
Hi catkin

Thanks for your valuable help. I got the meaning of this tty. Now I want to know that why there are so many tty (tty1, tty2, tty3.......so on). Do they have some restricted access levels etc....

Regards
_Linux_Learner

MrCode 03-18-2010 09:50 PM

Quote:

Now I want to know that why there are so many tty (tty1, tty2, tty3.......so on). Do they have some restricted access levels etc....
AFAIK it's so you can multi-task. :) Having more than one text terminal means you can be running a long (presumably non-interactive) process on one terminal, while doing something else on another.

But of course, if you have X11 (which most big distros do now), then you can do the same thing with virtual terminals within the graphical environment.

catkin 03-18-2010 11:16 PM

Quote:

Originally Posted by _Linux_Learner (Post 3903457)
Now I want to know that why there are so many tty (tty1, tty2, tty3.......so on). Do they have some restricted access levels etc....

No, they are all simply terminals at which you can log on in the normal way.

Your question is valid and you are in good company; the designers of Slackware didn't think there was any point in having so many when running a graphical screen so by default it comes with only two in graphical mode -- tty6 and tty7.

fbsduser 03-18-2010 11:37 PM

Quote:

Originally Posted by _Linux_Learner (Post 3903457)
Hi catkin

Thanks for your valuable help. I got the meaning of this tty. Now I want to know that why there are so many tty (tty1, tty2, tty3.......so on). Do they have some restricted access levels etc....

Regards
_Linux_Learner

There are so many tty's because when Linux was first made, X11 wasn't free or good enough to include it in Linux, which means that initially it was command line only and to multi-task you needed as much fullscreen terminals (tty's) as possible. Off-course you don't need them as much now that you can have as many pts's (xterm's) as you want within the graphical environment of X11.


All times are GMT -5. The time now is 01:12 PM.