xxxxxxxxxx
# WSL: Convert Linux Path to Windows
wslpath -w /path/to/convert
$ wslpath -w /mnt/c/Windows/System32/drivers/etc/hosts
C:\Windows\System32\drivers\etc\hosts
$ wslpath -w bin/tree
\\wsl.localhost\Ubuntu\home\username\bin\tree
# WSL: Convert Windows Path to Linux
wslpath -u "path\to\convert"
~ $ wslpath -u "C:\Windows\System32\drivers\etc\hosts"
/mnt/c/Windows/System32/drivers/etc/hosts
xxxxxxxxxx
%LOCALAPPDATA%\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs
xxxxxxxxxx
Adding a windows installed application to WSL path so we can run from Ubuntu wsl:
Install app on Windows.
Find the applications path to the folder where the executable file (app.exe) is located copy the path.
on WSL, go to the root folder where .bashrc is located
nano .bashrc
scroll to the end of file and add the path & alias using the format below
export PATH="$PATH:/mnt/c/Program Files/Amazon/AWSCLIV2"
alias aws='aws.exe'
save
apply changes by run source command below
source ~/.bashrc
Now, you should be able to run the application from anywhere in the WSL terminal
xxxxxxxxxx
>>> wsl wslpath -a 'C:\\aaa\\bbb\\ccc\\foo.zip'
/mnt/c/aaa/bbb/ccc/foo.zip