On Wed, 26 Jan 2000, Andy Thomas wrote:
> Where would I put the Linux equivalent to the above dos statement in order
> to get a prompt showing the current directory ($p) and the greater than
> ($g) symbol?  Is there some documentation as to all of the options I can
> put into my bash prompt?

(you can get detailed information from typing "man bash" but it's quite
extensive)

to get the prompt you want, you would type the command:
export PS1='$PWD> '

That will only be effective for that shell session though.
To make it happen all the time, add that command to your .bashrc
file in your home directory.  That file is a shell script is run every
time you log in (kind of like your own personal autoexec.bat)
Or you could add that line to /etc/bashrc if you want it to take effect
for all users' logins.

Alternatively, you can also use
export PS1='\w> '  ## it will display ~ in place of your home directory
or
export PS1='\W> '  ## prints the current dir name, but not the whole path

And if you're new to this, "export" is used by bash to set an environment
variable, and PS1 is the environment variable that determines the prompt.


 - David Nordlund

Reply via email to