Let us assume that I am not in my right mind, as no one who has used a good shell like bash, fish or oh (or any of the other shells listed here) would want this.

Nevertheless, seeing as one can have bash on Windows, has anyone tried to create CMD.EXE for Linux? If so, where can I get it from, and if not, why hasn't anyone done this?

I'm asking here because Google searches make assumptions about what I'm asking (probably because no one in their right mind would ask in the first place.)

  • 6
    Why? What can cmd.exe do what Linux command line can not? – Rinzwind Apr 27 '17 at 14:12
  • 5
    Just take any Linux shell and remove about 98% of the useful stuff. – Carl H Apr 27 '17 at 14:13
  • 2
    Closest you'll get to cmd is powershell, and best part is that "no one in their right mind" uses it anyways. So enjoy. – Ave Apr 27 '17 at 14:25
  • 2
    It's not exactly "CMD.EXE for Linux" but there's CMD.exe Emulator in Ubuntu to run .cmd/.bat file – steeldriver Apr 27 '17 at 14:29
  • 1
    I wish people would be more open-minded, I have an example where I need to run an .exe under Linux just so that I don't have to package up two different installers. I have a windows WAMP style application, and I'm also going to offer it online, served from Linux. Running the NSIS package executable under Linux keeps me from having to build two install packages. It's not always all about what's best, I used to argue that stuff all the time, now I have to do all kinds of things in real life that I never thought about. :) – Dan Chase Oct 28 '18 at 18:40

You can download Wine (https://www.winehq.org/) and use the Windows command line tool there that the Wine team has created. However, you will have to go digging through the .wine directory a bit, naturally, to find and execute it as it's in $HOME/.wine/drive_c/Windows/System32/cmd.exe if memory serves.

  • 1
    Mine's at ~/.wine/dosdevices/c:/windows/system32/cmd.exe – wjandrea Apr 27 '17 at 16:05

It's not quite the same topic, but some people make long lists of aliases for the most used DOS commands because they, for example, often type dir in a Linux shell:

alias dir=ls
  • That's great, but without a link this answer is not very useful. – wjandrea Apr 27 '17 at 16:06
  • a link to what? How to make an alias? I dont understand what you mean. – user680858 Apr 27 '17 at 16:19
  • Oh, I misunderstood what you wrote -- thought you meant there was a big list online somewhere. I clarified your answer. – wjandrea Apr 27 '17 at 16:24
  • I thought you meant something similar to this: Comparison of Common DOS and Linux Commands – wjandrea Apr 27 '17 at 16:26
  • 1
    ahh I understand what you mean. With your edits, I also understand I should be more specific next time. – user680858 Apr 27 '17 at 16:52

You can type "wine cmd" (without quotations) in the terminal and it will use DOS commands and have DOS backslashes with Z as root. If you have Wine, of course.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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