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.’