9

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.)

bugmagnet
  • 307
  • 1
  • 4
  • 15
  • 2
    It's not exactly "CMD.EXE for Linux" but there's [CMD.exe Emulator in Ubuntu to run .cmd/.bat file](https://askubuntu.com/questions/104474/cmd-exe-emulator-in-ubuntu-to-run-cmd-bat-file) – steeldriver Apr 27 '17 at 14:29
  • 1
    What can cmd.exe do what Linux command line can not? Well, it can run .cmd scripts for one. That can be useful if you have a lot of scripts that you don't want to rewrite. – Big Ed Aug 05 '20 at 14:14

3 Answers3

5

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
wjandrea
  • 14,109
  • 4
  • 48
  • 98
  • I thought you meant something similar to this: [Comparison of Common DOS and Linux Commands](https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/4/html/Step_by_Step_Guide/ap-doslinux.html) – wjandrea Apr 27 '17 at 16:26
  • Well, arguments are completely different between cmd.exe and Unix shells. For starters, DOS/Windows uses "/" instead of "-" to introduce options. – Raúl Salinas-Monteagudo Mar 11 '19 at 09:46
5

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.

2

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.

DeLauney
  • 21
  • 1