Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Sep 1997 11:32:57 +0100
From:      Martijn Koster <mak@webcrawler.com>
To:        Jose Monteiro <jm@pluriproj.pt>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Setting PS1
Message-ID:  <19970926113257.40412@webcrawler.com>
In-Reply-To: <342c7acd.3384017@mail.leirianet.pt>; from Jose Monteiro on Fri, Sep 26, 1997 at 09:11:57AM %2B0000
References:  <342c7acd.3384017@mail.leirianet.pt>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Sep 26, 1997 at 09:11:57AM +0000, Jose Monteiro wrote:

> What should I do [to .bash_profile] in order to get a prompt like:
> 
> jose@thor /usr/local$ cd bin
> jose@thor /usr/local/bin$

`man bash` of course :-)

          ...
          Bash allows these prompt strings to be customized
          by inserting a number of backslash-escaped special
          characters that are decoded as follows:
          ....
              \w   the current working directory

so do: 
 
   $ cd /usr/local
   $ export PS1='\u@\h \w$ '
   mak@mindy /usr/local$ cd bin
   mak@mindy /usr/local/bin$

-- Martijn Koster, m.koster@pobox.com




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19970926113257.40412>