1

I found that more pts can be created this way.

  1. To reboot into text mode-tty1
  2. to input startx to jump into gui mode.
    To enter terminal in the gui mode started from tty1 to inupt.

     tty    
     /dev/pts/0  
    

    this gui is pts/0

  3. to input ctrl+alt+f2 to jump into
    another text mode-tty2

  4. to input startx to jump into gui mode, this gui is pts/1.

    To enter terminal in the gui mode started from tty2 to inupt

    tty
    /dev/pts/1  
    

Now two gui modes can be created.
How to know how many tty and pts are running at the same time on my pc?

Every gui program--include virtual terminal in gui is the client(or say slave) of x-server(or say x window system) ,so it was called pesudo terminal slave.

Muru give me many new knowledge,maybe there is a wrong expression in muru's explaination. something about pts from other view

In my opinion,the proper sentence would be that:
but that's an application program in X server started from the tty1, but also a pts.

Please see the discuss here on :

enter link description here

enter image description here

From the knowledge,i draw my conclusion.

It not only an X server started from the tty1, but also a pts.

  • :"Now two gui modes can be created." Not on Unity. The tty7 used for Unity is hardcoded in the software – Rinzwind Jan 6 '17 at 6:30
0

this gui is pts/0

Um, nope. I'm not sure where you got pts/0 from, but that's an X server started from the tty1, it isn't pts/0. See this U&L post for more.

At any given time, by default, there are 6 TTYs with getty running on them (so that you can login there) - TTYs 1-6, which you can access using CtrlAltF1-F6. TTY 7 has the GUI started by default. On 16.04 and above, you can start more getty instances using:

systemctl start getty@ttyN

Replacing N with an appropriate number.

To find the number of pseudoterminals currently open, you can do:

ps -eo tty= | sort -u

ps -e lists all processes, and -o tty= lists the process TTYs without a header line. sort and get unique entries with -u. For example:

$ ps -eo tty= | sort -u
?
pts/0
pts/1
pts/2
tty1
ttyS0
  • To input tty in gui terminal ,we can get output info: pts/0 – it_is_a_literature Jan 6 '17 at 6:04
  • @it_is_a_literature Oh? Open a couple more terminals at the same time in the same GUI and check the output there too. – muru Jan 6 '17 at 6:05
  • Every gui program--include virtual terminal in gui is the client(or say slave) of x-server(or say x window system) ,so it was called pesudo terminal slave – it_is_a_literature Jan 8 '17 at 15:38
  • @it_is_a_literature that makes no sense. – muru Jan 8 '17 at 15:40
  • It does make sense,muru. – it_is_a_literature Jan 8 '17 at 15:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.