| View previous topic :: View next topic |
| Author |
Message |
andretti Tux's lil' helper

Joined: 25 Feb 2007 Posts: 86
|
Posted: Mon Jun 25, 2007 9:48 am Post subject: How to change the prompt? |
|
|
Is $PS1 something like PROMPT in DOS? Anyone know where this was set and where can I find documentation about this since I can find it in man..
My prompt is getting too long as I go down the tree, and I want to make it shorter like the one root is having... |
|
| Back to top |
|
 |
forrestfunk81 Apprentice


Joined: 07 Feb 2006 Posts: 252 Location: münchen.de
|
Posted: Mon Jun 25, 2007 10:34 am Post subject: Re: How to change the prompt? |
|
|
| andretti wrote: | | Is $PS1 something like PROMPT in DOS? |
Yes, it is something like this.
| Quote: | | Anyone know where this was set and where can I find documentation about this since I can find it in man.. |
Docu (first google hit searching for $PS1 )
I don't know where $PS1 is set, but you can overwrite the default settings by placing something like
| Code: | | export PS1="(myBash) $PS1" |
in your ~/.bashrc
greetz
$edit:
For system wide settings you can place it in /etc/bash/bashrc
Furthermore in /etc/bash/bashrc the prompt defaults are set.
Part of my /etc/bash/bashrc (think it's the default one)
| Code: |
if ${use_color} ; then
# Enable colors for ls, etc. Prefer ~/.dir_colors #64489
if type -P dircolors >/dev/null ; then
if [[ -f ~/.dir_colors ]] ; then
eval $(dircolors -b ~/.dir_colors)
elif [[ -f /etc/DIR_COLORS ]] ; then
eval $(dircolors -b /etc/DIR_COLORS)
fi
fi
if [[ ${EUID} == 0 ]] ; then
PS1='\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] '
else
PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] '
fi
alias ls='ls --color=auto'
alias grep='grep --colour=auto'
else
if [[ ${EUID} == 0 ]] ; then
# show root@ when we don't have colors
PS1='\u@\h \W \$ '
else
PS1='\u@\h \w \$ '
fi
fi
|
_________________ # cd /pub/
# more beer
http://outofctrl.eu/ |
|
| Back to top |
|
 |
swimmer Veteran


Joined: 15 Jul 2002 Posts: 1251 Location: Netherlands
|
|
| Back to top |
|
 |
di1bert l33t


Joined: 16 May 2002 Posts: 963 Location: Durban, South Africa
|
Posted: Tue Jul 10, 2007 2:45 pm Post subject: |
|
|
You might also want to check out app-shells/bashish which is quite entertaining
-m |
|
| Back to top |
|
 |
|