rzjnzk
rzjnzk

Reputation: 140

How to enter Windows-Subsystem-for-Linux (ubuntu) from PowerShell at the current PowerShell working dir

When running the command bash or ubuntu in PowerShell, the Windows-Subsystem-for-Linux is entered, however, the current working dir for PowerShell is not carried across to BASH. Is there a way to implement this functionality?

Upvotes: 3

Views: 15573

Answers (1)

Adam
Adam

Reputation: 4178

From your Windows Powershell or Powershell Core window, type bash (or wsl); for example:

enter image description here

Now, later versions of Windows include WSL.exe, which replaces bash.exe. The behavior of both executable is the same on my system. The official documentation for wsl.exe states:

enter image description here

You can read that documentation here. Net-net,

I'm running Windows 10 Build-17763. If you aren't experiencing the same behavior I am, you might be running an older version of WSL. You can determine the version of WSL from your build number.

Upvotes: 8

Related Questions