Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to add the value PS1='\u@\h: \w\$ ' to my terminal in XFCE. I added the line to (what I think is) the correct area in /etc/profile. The relevant segment is:

# Set a default shell prompt:
#PS1='`hostname`:`pwd`# '
PS1='\u@\h: \w\$ '
if [ "$SHELL" = "/bin/pdksh" ]; then
# PS1='! $ '
  PS1='\u@\h: \w\$ '
elif [ "$SHELL" = "/bin/ksh" ]; then
# PS1='! ${PWD/#$HOME/~}$ '
  PS1='\u@\h: \w\$ '
elif [ "$SHELL" = "/bin/zsh" ]; then
# PS1='%n@%m:%~%# '
  PS1='\u@\h: \w\$ '
elif [ "$SHELL" = "/bin/ash" ]; then
# PS1='$ '
  PS1='\u@\h: \w\$ '
else
 PS1='\u@\h: \w\$ '
fi

Most of that was already there, I just commented out the existing value and added the one I want.

By manually opening the terminal and doing . profile, I can load these values, but they don't stick - I close the terminal and reopen, and I'm back to sh-4.1$.

Maybe I'm doing this in the wrong place, but how can I make that value stick?

All the info I've found on google is Fedora/Ubuntu-specific. I use Slackware. Any help on this matter would be greatly appreciated.

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

This isn't about XFCE or your terminal; it's about your shell.

I'm guessing your login shell is /bin/bash. Bash reads several files on startup, depending on whether it's interactive, whether it's a login shell, and probably some other things. See the bash manual for the gory details.

For starters, check .bash_profile and .bashrc in your home directory.

Note that changing /etc/profile affects all users on the system. If you're the only user, it probably doesn't matter, but it's probably still better to make personal customizations in your own home directory.

share|improve this answer
    
.bashrc for me by default. –  Rob Oct 17 '11 at 13:33
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.