As you may already know, Windows 10 Anniversary Update comes with a Bash on Ubuntu console, which allows the user to access and launch Ubuntu apps on Windows. Targeted for console apps and services, it allows you to run even GUI apps with a trick. In this article, we will see how to run a Linux command from the cmd.exe prompt in Windows 10 directly.
You can omit the need for a separate console for Bash on Ubuntu in Windows 10 and run a specific command or a set of commands directly from the command prompt. This is possible thanks to the implementation of Bash on Ubuntu.
The bash console can be started via the following file:
This is a console app, which supports a number of command line arguments. You can learn them by running
As is apparent from the brief help it provides, you can call a Linux command directly using the following syntax:
bash -c "linux command here"
Watch the following video to see this trick in action:
Tip: You can subscribe to Winaero at Youtube.
That's it. Now you can extend your command line scripts with Linux apps.