2

My freebsd terminal always only show "#" I want it show current directory. How can I manage that? Thank you indeed!

2 Answers2

2

if using bash shell - in .bash_profile add:

PS1="[\u@\h:\w] " 
case `id -u` in
      0) PS1="${PS1}# ";;
      *) PS1="${PS1}$ ";;
esac
jet
  • 2,741
0

In FreeBSD 10.2, \u does not appear to work.

I replaced it with ´whoami´ as in the original prompt. Now it works fine.

PS1="´whoami´@\h:\w" 
case `id -u` in
    0) PS1="${PS1}# ";;
    *) PS1="${PS1}$ ";;
esac