3

If I try to cd ˜/ it responds:

-bash: "cd: ˜/: No such file or directory"

I also don't seem to have a .bash_profile or .profile.

2
  • Your PATH is broken, which makes sense if you have no .bash_profile or .profile. Check the answer at unix.stackexchange.com/questions/7076/…
    – user3463
    Aug 12, 2012 at 23:06
  • I sort of thought so, but all the commands work... just not ˜/ (that i've found) FYI when i type set my path looks like > PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin
    – Bert Smith
    Aug 12, 2012 at 23:59

3 Answers 3

16

That's the wrong tilde character. You typed a "small tilde" (unicode U+02DC), when you want a plain ASCII tilde character (unicode U+007E). Compare the following commands:

cd ~    # plain tilde: this works
cd ˜    # small tilde: doesn't work, because there's no file named "˜"
6
  • Soooo then where on my keyboard do i find the "Big" tilde, I mean the tilde character next the 1 key has worked for me in the past. This just seems to be a recent event. I guess it's possible that the key got re-mapped somehow???
    – Bert Smith
    Aug 13, 2012 at 1:55
  • Not doubting you answer (as i copied your cd command to my terninal and viola)... but I guess the real question is how do i fix it
    – Bert Smith
    Aug 13, 2012 at 1:58
  • @Bert Smith: Sounds like the correct key on the keyboard. Check your language and regional settings control panel (I'm not sure about the correct terminology for OS X).
    – martineau
    Aug 13, 2012 at 2:12
  • Does that key type the standard tilde or small tilde in other apps (e.g. if you type a tilde in TextEdit, then copy & paste it into Terminal, which one do you get)? If it's typing the small tilde everywhere, look in System Preferences -> Language & Text pane -> Text and Input Sources tabs (and possibly the Keyboard pane). If it's just Terminal, check its preferences, especially the Settings section -> Keyboard tab. Oh, and just to be sure: what kind of keyboard is it? Anything at all unusual (non-Apple, non-US, etc). Aug 13, 2012 at 4:35
  • Yes... small tilde everywhere and I'm using the built in keyboard on my 17"inch MBP running Lion
    – Bert Smith
    Aug 13, 2012 at 17:58
2

In your Mac keyboard if you type shift+` or option+n then you will get ˜.

If you want to type ~ use shift +`+spacebar.

1

If you use US International keyboard layout like me, this may solve your problem:

Right after pressing shift+˜, press space.

If you just keep typing the path with forward slash, the terminal will interpret your tilde like a small tilde instead of the normal one. This happens because it tries to combine both characters into one instead of just inputing what you typed.

1
  • As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Jun 2, 2023 at 19:46

You must log in to answer this question.

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