Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

…pseudo terminal file name associated to a terminal emulator window? I accidentally found it, just typed something like

$ echo $SOMETHING
/dev/pts/4

but forgot that variable, I googled it, looked in man pages, in ~/bash_history, but there are only commands of the first opened terminal and they're very old (~half a day) though.

share|improve this question
add comment

3 Answers

up vote 1 down vote accepted

you can use the tty command:

$ tty
/dev/pts/3
share|improve this answer
add comment

To get the current tty you can use the tty command

[sr@panther ~]$ echo "Your current TTY is $(tty)"
Your current TTY is /dev/pts/5

Or you can set it to a variable manually if you want

MYTTY=`tty`
echo $MYTTY
share|improve this answer
add comment

If you want to find an environment variable with some special value you can do:

env | grep "the value you look for"
share|improve this answer
    
I’ve tried grepping env. Nothing there contained such a value. –  tijagi Feb 5 '13 at 19:47
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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