Dear All,

How do I display the pathname to the BASH shell of the Linux Terminal?


If you simply wish to display what directory you're currently in, use the print working directory command:

$ pwd

If you wish for the prompt to always contain the current directory, you will need to edit the value of PS1 in .bashrc (located in your home directory) to contain \w. To view the current value of PS1:

$ echo $PS1

You can edit this value with vi (or your favorite editor):

$ vi ~/.bashrc

Locate and add \w to the value of PS1, for example:

PS1="\u@\h:\w$ "

Which would make the bash prompt look something like:


There is much more detailed information on editing .bashrc around the web. I hope this helps.

The path to the shell that is currently running in a terminal can be found in the 'SHELL' environment variable.

You can run 'echo $SHELL', which, on my machine, prints out '/bin/bash'.

Is this what you're looking for?