Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

In my ubuntu terminal I have always current directory shown completely. Just like this:


But in my Mac (Mac OS X 10.6.5) terminal does not show the full path and it is like this:

blabas-MacBook-Pro:classical beethoven$

Is there anyway that I change mac terminal behavior to act like linux terminal?

share|improve this question

migrated from Jan 31 '11 at 16:17

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

there must be a screen in preferences of Terminal App. which you can change behaviors. – fsonmezay Jan 31 '11 at 16:00
Linux terminals don't magically show the full path; it depends on your settings. Some linux distros configure things to show the full path by default, some don't. It all depends on the $PS1 variable. (See Asmus's answer.) – frabjous Jan 31 '11 at 18:37

To let bash return "user@hostname:path/to/directory$" as your prompt, add the following line to your ~/.bash_profile:

export PS1='\u@\H:\w$'


export PS1='\u@\H:\w$ '

if you like having a space between the $ and the command

to make the changes take effect immediately, run the following command in every open window (or restart Terminal):

source ~/.bash_profile
share|improve this answer
Or just enter that PS1 assignment in every open window. By the way, the export is unnecessary. – Dennis Williamson Jan 31 '11 at 16:37
Actually, if you don´t use export, your would be defining a shell variable, not an environment variable, so PS1 would not be passed globally to all processes. – Asmus Jan 31 '11 at 16:49
export com is working as suggested and showing full path, but once I restart the terminal it shows only present directory (not full path). How can I keep this forever. – JiteshW May 25 '15 at 7:53

I am not sure about Mac, but in Ubuntu I've changed the Gnome Terminal prompt with

PS1="\a\n\n\e[31;1m\u@\h on \d at \@\n\e[33;1m\w\e[0m\n$ "
share|improve this answer
I like this one cause it puts it on it's own line. thanks for this! – espradley Jun 12 '14 at 14:37
very cool!!!!!! – Nikos Oct 29 '14 at 9:19

Inside PS1 value, "\w" represents the full path, where "\W" represents the current directory name only.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.