How can I get the name of the current terminal from command-line?

Posted by Xubu-Tur on Ask Ubuntu See other posts from Ask Ubuntu or by Xubu-Tur
Published on 2014-06-04T09:51:12Z Indexed on 2014/06/04 15:44 UTC
Read the original article Hit count: 209

Filed under:

Is there a possibility to get the type of terminal with a command?

If I'm using gnome-terminal the output should be gnome-terminal or something similar. It would be also nice to get the version of the terminal.

Update

ps -aux | grep `ps -p $$ -o ppid=` 

will output something like this:

user     4239  0.0  0.7 292708 15744 pts/8    Sl   11:39   0:02 xfce4-terminal
user     4800  0.0  0.0   6176   820 pts/0    S+   12:23   0:00 grep --color=auto  4239

This will also work with xterm, but i don't know how to get only the name (xfce4-terminal in this case).

© Ask Ubuntu or respective owner

Related posts about command-line