I just had the problem, that the bash prompt of my universities
computer I've connected to via SSH looked like this:
bash-4.0$
Change the prompt
I think it's much more useful to see the path you're currently using.
To get the current path in your bash promt, you have to add the
following snippet to your .bashrc
:
# This will limit the path to 30 characters.
PROMPT_COMMAND='if [ ${#PWD} -gt 30 ]; then
myPWD=${PWD:0:12}...
${PWD:${#PWD}-15}; else myPWD=$PWD; fi'
PS1="\u@\h \$myPWD$ "
(Source: cyberciti.biz)
Reload your bash config with source .bashrc
and you should
instantly see the changes.
Aliases
# Add color to ls
alias ls="ls --color"
# simply update an svn-repository
alias swt='svn up /home/moose/Studium/SWT'