How do I fetch the current terminal name?I mean to the name that ps shows in the TTY column, e.g.:root@dor-desktop:/home/dor/Documents/LAMP_setup/webs_install/do/install# ps aux | egrep 'mysql|(^USER)'USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMANDdor       2238  0.2  1.9 448052 79796 ?        S    17:27   0:17 gedit /home/dor/Documents/LAMP_setup/webs_install/do/install/mysql.install /home/dor/Documents/LAMP_setup/webs_install/do/install/mysql.setuproot      4975  0.1  0.5 324984 22876 ?        S    18:12   0:04 gedit /usr/local/mysql/bin/mysqld_saferoot      8160  0.0  0.0   4108   664 pts/2    S    19:08   0:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --skip-networking --skip-grant-tables --user=mysql --basedir=/usr/local/mysql --ledir=/usr/local/mysql/libexecmysql     8279  0.0  0.4 146552 19032 pts/2    Sl   19:08   0:00 /usr/local/mysql/libexec/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/var --user=mysql --skip-networking --skip-grant-tables --log-error=/usr/local/mysql/var/dor-desktop.err --pid-file=/usr/local/mysql/var/dor-desktop.pid --socket=/usr/local/mysql/mysql.sock --port=3306root      8342  0.0  0.0   7632  1024 pts/2    R+   19:14   0:00 egrep --color=auto mysql|(^USER)In the above example, I need to fetch pts/2 which is probably the name for the current terminal that executed those commands.
Get current terminal name
bash;terminal
ttyNow I have to enter 30 characters where 3 would have been enough... :-)