-2

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
  • 2
    You are trying linux commands on a windows box. May 20, 2015 at 9:40

4 Answers 4

1

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.

1

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.

0

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

0

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 must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .