My freebsd terminal always only show "#" I want it show current directory. How can I manage that? Thank you indeed!
Asked
Active
Viewed 2,121 times
2
-
That's because you're logged in as root. – Rafe Kettler Dec 24 '10 at 06:24
-
Check here for all the shell customization information you can stand: http://www.geekvenue.net/chucktips/jason/chuck/1039988302/index_html – Cody Gray - on strike Dec 24 '10 at 06:29
-
type pwd (print working directory) for quick look – Eric Fortis Dec 24 '10 at 06:30
2 Answers
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
Serge Stroobandt
- 2,145