-1

I am new to the Mac OSX environment, and was programming in C using the terminal. To change the current directory, I used the command cd .. to go one level up. However, this had a weird effect on the terminal. A clear screen on my mac terminal normally used to show this path always-

manishs-mbp:manishgiri$

However, since the time I did cd .. (to go one level up), the current pathway of the terminal has changed to:

manishs-mbp:~ manishgiri$

As you can see, there is a tilde now in the pathname. On reading about it, it looks like this tilde is used to represent the home directory in mac os. However, i would like to get rid of it, as it was earlier.

I tried to think of it, and realized that cd .. would have taken me one level up. So, I entered pwd in the terminal to see the current pathway(this is with the tilde situation), and got this-

manishs-mbp:~ manishgiri$ pwd
/Users/manishgiri

Maybe the tilde appears because I am now by default in the /Users(Home) folder. If that's the case, then how do I revert it back to the previous settings to get rid of the tilde?

Any help on this would be highly appreciated, thank you.

Manish Giri
  • 3,562
  • 8
  • 45
  • 81

1 Answers1

1

Try

PS1=`pwd `

to set your prompt.

If you like that, check in your home directory for a file called .profile and edit PS1 setting permanently into there.

This may help.

Mark Setchell
  • 191,897
  • 31
  • 273
  • 432
  • Apologies for the delay in answering. While I wasn't able to do precisely what I needed, following your link, I got to know that the bash shell on my mac(as with any other mac) is configured to show the current working directory basename. I used `echo $PS1` and understood that basically what I was looking to do was to remove `\W` from the resulting output `\h:\W \u\$`. This involved permanently making a change of the `PS1` variable in the shell's config file(`.bashrc`), and apparently it's not advisable for beginners(?), so I left it at that. But still, thanks a ton for the help! – Manish Giri Jun 18 '14 at 02:35