Editing PS1
Code:
#PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\h\[\033[01;34m\] \w \$\[\033[00m\] ' The above is from my ~/.bashrc file. But take a look at my prompt. Code:
user@host ~/projects/learningCenter/udemy/learnAndUnderstandCPP/section6 $ |
Change the lower case w to upper case W. The upper case W shows the basename of the current working directory.
See the Bash Prompt HOWTO for more information http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/ |
wrong way round use
Code:
keithhedger@LFSHal: KKFileManager $PS1="\u@\h: \W \$" |
I changed the .bashrc line to:
#PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\h\[\033[01;34m\] \w \$\[\033[00m\] ' PS1="\u@\h: \W \$" And I'm still getting user@host ~ $ cd projects/learningCenter/udemy/learnAndUnderstandCPP/section6/ user@host ~/projects/learningCenter/udemy/learnAndUnderstandCPP/section6 $ |
Update, the line PS1="\u@\h: \W \$" worked when I inputed it directly into the terminal but it's not having any affect from .bashrc. Also, even though it temporarily achieved my goal when I inputed it directly into the terminal it also caused the prompt to lose all of it's coloring. Also note that I did source .bashrc and completely exited and reopened as well.
|
PS1 may be getting changed what does
Code:
echo "$PS1" |
I got it. Instead of trying to insert my own line I just modified the existing line in the .bashrc file and replaced all the 'w's with 'W'. Thanks for your help.
|
All times are GMT -5. The time now is 08:18 PM. |