LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-11-2011, 09:54 AM   #1
ebbs
LQ Newbie
 
Registered: Aug 2011
Posts: 7

Rep: Reputation: Disabled
tty & pts


I have 7 tty and 22 pts that are active. How can I tell what pts goes to what tty?
 
Old 08-11-2011, 12:08 PM   #2
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Ubuntu 10.10, Slackware 64-current
Posts: 2,124

Rep: Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778
Try looking at the output of the 'who' command.
 
Old 08-11-2011, 12:48 PM   #3
ebbs
LQ Newbie
 
Registered: Aug 2011
Posts: 7

Original Poster
Rep: Reputation: Disabled
The who command is how I knew that there were more pts entries than tty. How do I know what pts goes to what tty? The who command does not display the tty. Is there an option for who that is not in man who?
I got the tty info by ps -ef|grep tty.
 
Old 08-12-2011, 07:51 AM   #4
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Ubuntu 10.10, Slackware 64-current
Posts: 2,124

Rep: Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778
Use a combination of 'who' and 'ps -aux' sorting through grep for the keywords pts and tty. Here is an example:
Code:
me@decwwarbler01:~$ ps aux | grep pts
me       13365  0.0  0.0  11396  1480 ?        S    08:43   0:00 sshd: me@pts/0
me       13366  0.0  0.0   3168  1780 pts/0    Ss   08:43   0:00 -bash
me       13407  0.0  0.0   2500   884 pts/0    R+   08:45   0:00 ps aux
me       13408  0.0  0.0   2212   636 pts/0    S+   08:45   0:00 grep pts
me@decwwarbler01:~$ ps aux | grep tty
root      1593  0.0  0.0   1800   468 tty1     Ss+  Jul19   0:00 /sbin/agetty 38400 tty1 linux
root      1594  0.0  0.0   1800   476 tty2     Ss+  Jul19   0:00 /sbin/agetty 38400 tty2 linux
root      1595  0.0  0.0   1800   472 tty3     Ss+  Jul19   0:00 /sbin/agetty 38400 tty3 linux
root      1596  0.0  0.0   1800   476 tty4     Ss+  Jul19   0:00 /sbin/agetty 38400 tty4 linux
root      1597  0.0  0.0   1800   472 tty5     Ss+  Jul19   0:00 /sbin/agetty 38400 tty5 linux
root      1598  0.0  0.0   1800   476 tty6     Ss+  Jul19   0:00 /sbin/agetty 38400 tty6 linux
me       13413  0.0  0.0   2216   652 pts/0    S+   08:46   0:00 grep tty
me@decwwarbler01:~$ who
me        pts/0        2011-08-12 08:43 (172.31.239.108)
As you can see, the system automatically creates several TTY sessions. TTY sessions would typically be those with a local keyboard. These are the default sessions created at startup and that can be access with ALT-Fx. Similarly, I am logged in via a pts session and you can see the process that I have launched in that session. The who command shows that my user is associated with pts/0 (pseudo-tty0).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
tty and pts culin Linux - General 5 03-07-2013 05:59 PM
[SOLVED] what is meant by Console , tty ,pts. idnotcrae Slackware 12 06-28-2011 10:53 AM
difference between tty and pts _Linux_Learner Linux - Newbie 10 03-18-2010 11:37 PM
TTY pts/# terminals increasing. Technoslave Linux - General 1 04-22-2004 01:28 PM
Bash: How to tell a tty from a pts? m0rl0ck Programming 4 08-21-2003 06:26 AM


All times are GMT -5. The time now is 05:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration