Question

Why do I get this in MSYS?

user@lappy1 ~
$ mkdir test
sh: mkdir: command not found

Basic commands like cd and pwd work just fine. What happened to mkdir?

Was it helpful?

Solution

looks like your $PATH is not set up properly, or your startup sequence is broken. what's the result of echo $PATH? there should be something like .:/usr/local/bin:/mingw/bin:/bin in the beginning. mkdir should be in /bin, so if you have /bin in the PATH, it should work. if there is no mkdir in /bin, check your installation. the PATH is initialized from /etc/profile - look if there is something like export PATH=... in it. /etc/profile is read when bash is invoked as login shell, so also check if bash is started with the --login (-l) option (this usually happens from msys.bat). last, cd and pwd are shell builtin commands, so they work in the shell regardless of any PATH setting.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top