Tilde not recognized in Mac terminal

rasheqrahman picture rasheqrahman · Jan 30, 2012 · Viewed 17.4k times · Source

I have this weird situation on my Mac running OSX Lion where the ~ (tilda) does not go to my user directory. Instead when I type "cd ˜", I get:

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

Any advice on how to fix this?

Answer

Venkat Ganesh picture Venkat Ganesh · Jan 25, 2016

After changing the keyboard (System Preferences>Keyboard>Input Sources) from 'US International - PC' to 'U.S.', I was able to verify tilde sign (~) works as expected from Terminal.

It looks like in some of the macbook, the keyboard is set to 'US International - PC' instead of 'U.S.'

Compares the different keyboard layouts while pressing SHIFT