Exit the Linux shell back to command prompt

With the Windows Subsystem for Linux enabled, you can switch to the Linux shell by running bash in command prompt. Is it possible to go the other way, and switch back to the command prompt?

5 Answers

Type exit to terminate the shell and return to the calling program.

You can use logout in bash to return to command prompt.

bash

As someone already answered to use exit to back to Command prompt

i was using tmux and i can't use exit as it will close the session. instead of going back.

so, i have to use cmd.exe to use command prompt o

The best thing is now you can use tmux for command prompt.

1

Build 14951 adds the ability to execute .exe files in Bash. Many Windows executables are in directory /mnt/c/Windows/System32. Bash command names distinguish upper case and lower case letters and include ".exe" suffix.

1

Unfortunately, no.

When running bash from the command prompt, it executes the bash program. You can see the executable itself, by typing the following into the command prompt:

where bash

This results is C:\Windows\System32\bash.exe

Bash is a Windows console application. That is why you can run it from the command prompt.

It doesnt work the other way around. Although Bash has file system access to C:\Windows\System32\cmd.exe (the Windows command prompt), it is not a binary application that it understands.

I suppose you could create a workaround. You could enable telnet/SSH on Windows and login that way to get the Windows command prompt.

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like