Command to know in which terminal we are located

This is a little tip, but sometimes it can help us with a task we are doing, or simply… it is always good to learn something new 

How do we know which terminal we are using?

We all know that if we run:

who

Something like:

kzkggaara pts / 0 2012-10-02 21:47 (: 0)
kzkggaara pts / 1 2012-10-02 23:07 (: 0)
kzkggaara pts / 2 2012-10-03 08:15 (: 0)
kzkggaara pts / 3 2012-10-03 09:08 (: 0)
kzkggaara pts / 5 2012-10-03 10:54 (: 0)

But, we cannot know exactly which terminal we are in, that is, in which one we execute the command ... to achieve this, we execute:

tty

This will tell us something like:

/ dev / pts / 31

And indeed, that is the terminal they are at 

And that's all for this command, I've discovered more interesting things in the system... I'll put them here soon 

regards


Add as preferred source in Google