Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question

migrated from stackoverflow.com Dec 24 '10 at 16:10

This question came from our site for professional and enthusiast programmers.

    
That's because you're logged in as root. – Rafe Kettler Dec 24 '10 at 6:24
    
Check here for all the shell customization information you can stand: geekvenue.net/chucktips/jason/chuck/1039988302/index_html – Cody Gray Dec 24 '10 at 6:29
    
type pwd (print working directory) for quick look – Eric Fortis Dec 24 '10 at 6:30
up vote 2 down vote accepted

if using bash shell - in .bash_profile add:

PS1="[\u@\h:\w] " 
case `id -u` in
      0) PS1="${PS1}# ";;
      *) PS1="${PS1}$ ";;
esac
share|improve this answer

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
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .