LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Changing the BASH Prompt (https://www.linuxquestions.org/questions/linux-newbie-8/changing-the-bash-prompt-163537/)

Blade_Powers 03-28-2004 07:19 PM

Changing the BASH Prompt
 
Accidentally posted this in the general forum, meant to post it here.



Hi,

Fairly new to Linux here.

I would like to change my BASH prompt to the full path followed by the $.

When I add the line:

export PS1="[\w] \$ "

in my .bashrc file in my home directory, my prompt displays as:

[~] $

To see if maybe I was not putting the right information in the export line, I tried a couple more escape characters.

export PS1="[\d] \$ " displayed:

[Sun Mar 28] $

export PS1="[\W] \$ " displayed:

[pete] $

Here is my entire .bashrc file:

# .bashrc

# User specific aliases and functions

# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi

export PS1="[\w] \$ "

And here is the value of my BASH_VERSION environment variable:

2.05b.0(1)-release

Does anyone know if the \w was deprecated?

If I have not provided enough information, please let me know
Any help would be appreciated, Thanks

Pete

Tinkster 03-28-2004 07:26 PM

It's all good, you just coincidently happen
to be in your home directory, which, in the
shells abbriviations, is ~ ... try a cd /usr
;)


Cheers,
Tink

Blade_Powers 03-28-2004 07:53 PM

DOH! lol.

Thanks Tink

Tinkster 03-28-2004 08:39 PM

Pleasure mate :}


And sorry, I didn't welcome you!

Welcome to LQ, I usually don't overlook the post-number :}




Cheers,
Tink

statmobile 03-28-2004 09:21 PM

I always find this site useful:
Prompt Magic


All times are GMT -5. The time now is 04:43 AM.