Skip to content

Instantly share code, notes, and snippets.

@ha7ilm
Created September 2, 2023 10:01
Show Gist options
  • Save ha7ilm/b957ab9b07171dcd331b1be14248b9fc to your computer and use it in GitHub Desktop.
Save ha7ilm/b957ab9b07171dcd331b1be14248b9fc to your computer and use it in GitHub Desktop.

wcd -- cd to a Windows-style path in WSL

What does it do?

user@windows / $ wcd 'C:\Test'
user@windows /mnt/c/Test $

You have to use '' around the path.
End of user manual.

How to install it?

I added this to the .zshrc:

wcd () {
        cd $(wslpath $1)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment