thedanotto
thedanotto

Reputation: 7327

.bash_profile PS1 to show current directory folder and a $ MAC osx

In my .bash_profile I currently have

PS1="$ "

which in my terminal returns '$ '

I want to show the current folder as well.

if I run the command, pwd /Users/Me/Sites/

I would want my bash prompt to return 'Sites$'

Thanks for all your help.

Upvotes: 14

Views: 17359

Answers (2)

Mark Shust at M.academy
Mark Shust at M.academy

Reputation: 6429

Note that if you don't want brackets or colors surrounding the current directory, you can use the simpler:

export PS1="\W$ "

Upvotes: 7

Mikolaj
Mikolaj

Reputation: 708

try this:

PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] [\w]\[\033[00m\]'

Upvotes: 21

Related Questions