Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use Ubuntu 12.04. I am logged-in to tty2, tty1 and tty7.

In my textbook I read that the whoami command allows me to determine which console I am using. But this command merely shows my login. As for the command who, it always lists tty2, tty1 and tty7. So, even the order of these consoles can't help me.

Could you help me how to determine the current console?

share|improve this question

migrated from Oct 1 '12 at 20:50

This question came from our site for professional and enthusiast programmers.

How about the tty command? – Joachim Isaksson Sep 30 '12 at 8:35
pls accept one of these answers so it won't show up as an unanswered question.. – gokcehan Sep 30 '12 at 9:33

Use tty

$ tty

Just remove the /dev/ and you've got it.

share|improve this answer


$ tty | sed -e "s:/dev/::"
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .