My command prompt won't run any simple commands such as man, ls or pwd. It only shows the following error:

"xxxxxx" is not recognized as an internal or external command, operable program or batch file.

Does anyone know the solution?

  • 1
    You are trying linux commands on a windows box.– Dmitry GrigoryevMay 20 '15 at 9:40

man, ls and pwd are not Windows commands. Install Cygwin or Linux instead, or type Help and learn the names of commands you can use at the Windows command prompt.

    The Windows command prompt does not support running programs as do bash or zsh. You could run bash (using MinGW, etc), but those do not honor Window batch commands.

    Other solutions such as Cygwin are possible, but take you even further away from native Windows features.

    There are of course various shareware programs which could be used, some of which claim to be compatible with Windows batch commands. But there appear to be no usable third-party reviews, so it is difficult to make recommendations. In any case, lists-of-things is outside the scope of this site.

    For Windows as it is, "help" lists commands (not an all-inclusive list, by the way - use /? as an option for others). Each of the listed commands can be explored further, but those for for, if and set are lengthy. You might be better off also using the Microsoft website for this topic, e.,g Using batch files

      Unix commands aren't available by default on a Windows system. Native Windows versions of the standard GNU tools are provided by the GnuWin32 Project.

      Alternatives:

      • MSys: Unix utilities, mostly for programmers. Intended as a supplement to the MinGW development tools.

      • Gow: A lighter alternative to Cygwin.

      • Cygwin: Provides a full Posix environment.

      • UWin: Unix emulation.

      • Windows Services for UNIX: Microsoft's UNIX subsystem. Probably not open source.

        You could try PowerShell.

        Depending on the version of Microsoft Windows, the commands you mention (man, ls, pwd) may be entirely invalid.

        Newer versions of Microsoft Windows do support all of those commands, but not from the "Command Prompt" icon. Instead, they need to be run from PowerShell. For example, in Windows 7, go to Program, Accessories, Windows PowerShell, Windows PowerShell, which runs:

        %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe

        Presumably details (about how to find that software) may vary with different versions of Microsoft Windows.

        However, these commands are not supported by the traditional "Command Prompt" icon which runs CMD.EXE or (particularly with older versions of Microsoft Windows) COMMAND.COM

        So, what this means is that you just need to be careful about which command prompt you are using. You want the "PowerShell" variation.

        You won't be able to run those commands (man, ls, pwd) from within CMD.EXE or COMMAND.COM by using just the software built into a typical Windows installation. However, there may be some ways to get those commands to be supported, by installing some support for running Unix commands, which some of the other answers here mention.

          Your Answer

           
          discard

          By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

          Not the answer you're looking for? Browse other questions tagged or ask your own question.