4

I ran the last command in Linux; I got the output:

pts/0, pts/1, pts/2, pts/3, pts/4 and pts/5

What does pts mean?

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
Ahmed Vagher
  • 109
  • 5
  • 2
    Hello Ahmed, and welcome to U&L! Don't be afraid to use the search bar for key words in your question -- for example, http://unix.stackexchange.com/questions/21280/difference-between-pts-and-tty would be a good start. – Jeff Schaller Oct 13 '15 at 18:13

1 Answers1

8

The pts/0 is telling you which "pseudo terminal" the user was logged in on. In this case it's terminal 0,1,2 etc.

A tty is a native terminal device, the backend is either hardware or kernel emulated.

A pts (pseudo terminal device) is a terminal device which is emulated by an other program (example: xterm, screen, or ssh are such programs).

Manuel Jordan
  • 1,414
  • 9
  • 33
magor
  • 3,592
  • 2
  • 11
  • 27
  • Thanks Mazs,Can we get the description of that in the last command,Say like if it is pts/1 it is for ssh,pts/2 it is from winscp,pts/3 it is su. – Ahmed Vagher Oct 13 '15 at 19:20
  • @AhmedVagher No, absolutely not. The first pseudoterminal that's created gets the number 0, the next one gets 1 and so on. – Gilles 'SO- stop being evil' Oct 13 '15 at 22:06
  • Just worth noting that different naming/numbering schemes exist, e.g. one pty might be at /dev/ptyp0. – phk Oct 13 '15 at 23:14
  • @AhmedVagher As you're a reputation 6 user: If this answer helped you, don't forget to click the grey **☑** at the left of this text, which means [Yes, this answer is valid](http://unix.stackexchange.com/help/accepted-answer)! **;-)** – Fabby Oct 13 '15 at 23:47
  • Actually "pts" stands for pseudo-terminal-slave. The answer as given confuses tty and pty, making it less than useful. – Thomas Dickey Oct 14 '15 at 00:41