David Nordlund wrote:

> 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

For some really great prompts check out the BashPrompt Home Page:
http://bash.current.nu/

Also go to Gary's Encyclopedia and search in the Linux area:
http://members.aa.net/~swear/pedia/index.html

Larry

Reply via email to