Computer Science, asked by nn5427382, 8 months ago

how can you identify your terminal name?Discuss​

Answers

Answered by sairamcharan28
0

Explanation:

One way to do this is to get the parent process of your current shell session and from there the name of the terminal.

Get the parent of the current shell process. The bash variable $$ is the PID of your current shell, so we can give that as a query to ps (-p $$) and ask it tp print the PID of the parent process (-o ppid=, the trailing = is to avoid printing column headers):

$ ps -p $$ -o ppid=

Similar questions