LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 08-02-2007, 12:27 AM   #1
culin
Member
 
Registered: Sep 2006
Distribution: Fedora Core 10
Posts: 254

Rep: Reputation: 32
tty and pts


Hi all,
i have some doubts regarding tty and pts...
for example this is a part of the output from my pc when i run ps -aux
Code:
root      2893  0.0  0.0   1552   364 tty1     Ss+  Jul09   0:00 /sbin/mingetty tty1
root      2894  0.0  0.0   1552   364 tty2     Ss+  Jul09   0:00 /sbin/mingetty tty2
root      2895  0.0  0.0   1556   364 tty3     Ss+  Jul09   0:00 /sbin/mingetty tty3
root      2896  0.0  0.0   1552   364 tty4     Ss+  Jul09   0:00 /sbin/mingetty tty4
root      2897  0.0  0.0   1552   364 tty5     Ss+  Jul09   0:00 /sbin/mingetty tty5
root      2898  0.0  0.0   1556   364 tty6     Ss+  Jul09   0:00 /sbin/mingetty tty6

root     14702  0.0  0.2   4424  1200 pts/6    S    10:15   0:00 su
root     14705  0.0  0.2   4516  1488 pts/6    S    10:15   0:00 bash
root     18128  0.0  0.1   4488   928 pts/6    R+   10:44   0:00 ps -aux

root     14552  0.0  0.2   4424  1196 pts/4    S    10:09   0:00 su
root     14555  0.0  0.2   4512  1464 pts/4    S    10:09   0:00 bash
root     14575  0.0  0.3   4516  1528 pts/4    S+   10:10   0:00 bash
IN THE ABOVE OUTPUT....in the TTY column.. what is the meaning of tty1 tty2 and so on.. and pts/4 pts/6 and so on...
whether tty and pts are abbrevations ?
please share ur knowledge on these things..
1. what is the meaaning of tty or TTY ? what is the significance of this column in ps ouptut
2. what is the usage or use of tty ?
3. what is pts ?
4. what is the difference between tty1 tty2 and ttyS1 ttyS2 and other tty's
thanks..
 
Old 08-02-2007, 12:42 AM   #2
Simon Bridge
Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 197Reputation: 197
tty = teletypewriter - it refers to the terminal that is running the process. (man tty)
pts = pseudo terminal - similar to above. (man pts)

The TTY heading is explained in the man page for ps (man ps)

ttySx is a serial device terminal... the old style notation.

btw:

ps -aux is supposed to list processes for user name "x". You should use ps aux instead, even though the program can handle this obvious typo.

Last edited by Simon Bridge; 08-02-2007 at 12:45 AM.
 
1 members found this post helpful.
Old 08-02-2007, 01:18 AM   #3
culin
Member
 
Registered: Sep 2006
Distribution: Fedora Core 10
Posts: 254

Original Poster
Rep: Reputation: 32
Thanks for the info Simon Bridge,
but when someone connects to my PC through telnet it displays it as pts/4 or pts/6, so is there any device file naming convention followed by linux...?? say for serial devices and other devices ?
 
1 members found this post helpful.
Old 08-02-2007, 01:43 AM   #4
Simon Bridge
Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 197Reputation: 197
Did you read the man pages? That question is answered in the first paragraph.

Code:
NAME
       ptmx and pts - pseudo-terminal master and slave

DESCRIPTION
       The  file  /dev/ptmx  is a character file with major number 5 and minor
       number 2, usually of mode 0666 and owner.group  of  root.root.   It  is
       used to create a pseudo-terminal master and slave pair.

       When a process opens /dev/ptmx, it gets a file descriptor for a pseudo-
       terminal master (PTM), and a pseudo-terminal slave (PTS) device is cre‐
       ated  in the /dev/pts directory.
When someone telnets into your system, linux sets up a pair of terminals - a master and a slave. The terminals live in the directory /dev/pts/ of the appropriate host and is named for the terminal number. i.e. /dev/pts/0

BTW: you shouldn't allow telnet. Use ssh instead.

<off your sig> It is not "u" but "you" who learns from mistakes.
When someone directs you to a man page, read it or risk an RTFM.
 
1 members found this post helpful.
Old 08-02-2007, 04:30 AM   #5
culin
Member
 
Registered: Sep 2006
Distribution: Fedora Core 10
Posts: 254

Original Poster
Rep: Reputation: 32
ok thanks for that information....and i have altered my signature too.[]
 
1 members found this post helpful.
Old 03-07-2013, 05:59 PM   #6
gaosanyong
LQ Newbie
 
Registered: Mar 2013
Location: Los Angeles
Distribution: Ubuntu 12.10
Posts: 3

Rep: Reputation: Disabled
Hi culin,

TTY (TeleTYpewriter ) ports are direct connections to the computer such as a keyboard/mouse or a serial connection to the device. PTS (Pseudo Terminal Slave) connections are SSH connections or telnet connections. All of these connections can connect to a shell which will allow you to issue commands to the computer.

Original URL: http://www.question-defense.com/2009...terminal-types
 
1 members found this post helpful.
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
pts/0, pts/1 devices ?? nadine.mauch Linux - General 1 10-07-2004 11:00 AM
change tty => system crashes (ati driver/tty resolution) mosca Debian 6 08-05-2004 07:37 AM
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
rxvt: can't open slave tty /dev/pts/3 kater Linux - General 2 02-26-2003 06:39 PM


All times are GMT -5. The time now is 04:34 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration