How to check which tty I'm currently using?
There are several ways to find this out. I would go with the who am i
(not who
) command:
$ who am i
ravexina tty2 2017-04-10 11:19 (:0)
When I'm in a graphical terminal, it would return something like:
ravexina pts/0 2017-04-10 1:19 (:0)
Under ssh session using a graphical terminal result is the same, but instead of (:0), I will get my machine IP (192.168.x.x). other commands like w
, who
, pgrep
, ps
, etc are helpful too.
For example to find out at which tty
my graphical interface is running:
ps $(pgrep Xorg)
Which in my case, because I don't use any display manager like gdm or slim it will produce:
PID TTY STAT TIME COMMAND
1693 tty1 Sl 0:05 /usr/lib/xorg/Xorg
Use tty
command.
If I am right this is the reference:
/dev/tty1 - tty1
/dev/tty2 - tty2
/dev/tty3 - tty3
/dev/tty4 - tty4
/dev/tty5 - tty5
/dev/tty6 - tty6