This answer is based on the assumption that you are using the command line to execute these commands.
The reason that you can ls directory, but not cd to it, is because the ls comes from a library you loaded that does ls work on windows.
In contrast, your cd is executed from Windows, not from the library you downloaded.
In short, ls knows how to parse a tilde ( ~ ) at home, but windows can't parse ~ . try: cd ~ . it will not work.
source share