This is a small tip, but sometimes it can help us with a task that 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 in 😀
And this has been all for this command, I have discovered more interesting in the system ... I'll put them here shortly 😀
regards
And why don't you try "who am i"?
For example :
[jose @ portatil_hp ~] $ who am i
jose pts / 1 2012-10-03 23:57
Interesting 😀
Knew whoami … Which shows the nickname or userlogin, but I never tried to run it separately 🙂
I said, in Linux we always have more ways of doing things than we know.
Thanks for the tip 😉
"Who am i"?
Hahaha, take them, what movie did you get it from !?
Please xD
Well it works 😉… as incredible as it may seem, IT WORKS! 😀
What works is only the who 😉
From "Tron: Legacy"
Well, curious to me with who returns:
david tty7 2012-10-03 20:11
open several terminals and run it again 😉
I have several terminals open, it returns all of them, and if I want to know specifically in which one I typed the command, well, who gives me more data than I want 😀
Old acquaintance that good to know: D!
As all character devices, the console accepts sequential feeding, try sending data directly to the device's address to see it on the screen in a transparent way 😀