What shell do you use? That's Question Number 1. I have some fancy Bash scriptage that will show you your directory in bold. If you happen to be in your home directory, or some subdirectory of your home directory, it prints something like
HOME/directory1/directory2
I'll try and dig it up. It's at work right now, and I'm not.
Put this in your .bashrc. I don't think it works for ksh because I don't think ksh has the facility for the PROMPT_COMMAND variable.
Check out my fancy "case" command in the "pc" function. Feature of note: if the prompt is longer than however many question marks appear there, then the prompt will actually wrap to the second line. ...Keeps you from having something silly like 5 characters to type into on an 80-char-wide screen (that's a problem with ksh that I've had).
############################################################################
# PROMPT
############################################################################
if [ "$TERM" != "void" -a "$TERM" != "dumb" ] ; then
if [ `uname -s` = "Linux" ] ; then
# Some sort of bug makes me have to do this...
enhance=`tput bold; tput setf 1`
normal=`tput sgr0`
else
enhance=`tput bold`
normal=`tput rmso`
fi
PROMPT_COMMAND=pc
fi
if [ -x /bin/hostname ] ; then
hostcmd="/bin/hostname"
elif [ -x /bin/uname ] ; then
hostcmd="/bin/uname -n"
fi
myhostname=`$hostcmd | sed -e 's/\\..*//'`
if [ -x /usr/ucb/whoami ] ; then
myname=$(/usr/ucb/whoami)
else
touch /tmp/temp$$
myname=$( ls -l /tmp/temp$$ | awk '{print $3}' )
rm /tmp/temp$$
fi
if expr $myname = "root" > /dev/null 2>&1 ; then
mark="#"
else
mark='$'
fi
tprompt="[$myname@$myhostname]"
titlebar="$myhostname ::: $myname "
function pc
{
pc_wd=`pwd`
if [ \( "$TERM" = "vt100" \) -o \( "$TERM" = "xterm" \) ] ; then
wt "$titlebar << `pwd` >>" > `tty`
fi
# go to a 2-line prompt if >38 chars in path...
case "$pc_wd" in
/)
pc_path="/" ; pc_suffix="\\$ "
;;
$HOME)
pc_path="~" ; pc_suffix="\\$ "
;;
??????????????????????????????????????*)
pc_path=$pc_wd ; pc_suffix="\n\\$ "
;;
*)
pc_path=$pc_wd ; pc_suffix="\\$ "
;;
esac
# Sometimes Linux is funny. I have left this if statement in for future
# consideration, even though there's no diff between if and else...
if [ `uname -s` = "Linux" ] ; then
#PS1="\!${tprompt}${pc_path}${pc_suffix}"
PS1="\!\\[$enhance\\]${tprompt}${pc_path}\\[$normal\\]${pc_suffix}"
else
PS1="\!\\[$enhance\\]${tprompt}${pc_path}\\[$normal\\]${pc_suffix}"
fi
return
}
# X title stuff
wt ()
{
echo -n "^[]2;${@}^G" # In all of these, ^[ is really the "escape" character.
#You put it into a file using vi, by typing control-V and then hitting the Escape key.
# Likewise, ^G is the control-G character. Again, hit control-V then hit control-G
}
it ()
{
echo -n "^[]0;${@}^G"
}
defwt ()
{
echo -n "^[]2;$(whoami) @ $(hostname)^G"
}
cls ()
{
# works only for vt100's and the like
echo "^[[;H^[[2J"
}