When working with paths, it is generally easier to use the functions in Base.FileSystem for these kinds of things, i.e. use homedir() for ~ along with readdir() and mkdir().
This makes it easier to run code across platforms.
Also, for the mkdir example, try:
julia> run(`mkdir "~\\tmp"`)
It should make a folder named ~/tmp starting from the current working directory. Probably not the intended effect.
EDIT: So the mkdir example worked on one computer, but it failed on a different computer (both Win10). That’s probably because one computer had some build tools installed which over-ride some of the default windows commands (mkdir example worked on this one).
I think Julia is just passing the tilde without interpreting it.
The git and sh -c commands are interpreting it.
Though on my system, neither version interprets ~ as home directory—both of them create a ~/tmp folder starting from pwd.
EDIT: Tried it on the second computer, and the sh -c version works properly there (again an issue with different build tools). The specific sh command is bundled with git, and it interprets ~ as the home directory. This can be verified by running where sh and sh -c "~" in cmd.