If you're working within the Windows Subsystem for Linux (WSL) and need to open the current directory in Windows Explorer, you can use the following commands. WSL automatically sets the Windows path for you.
explorer.exe .
This command will launch Windows Explorer with the current directory open.
To make this process more convenient, you can set up an alias in your .bashrc
file. This way, you can use a custom command, such as explorer
, to open the current directory.
echo 'alias explorer="explorer.exe ."' >> ~/.bashrc
The above command appends an alias definition to your .bashrc
file, which associates the explorer command with explorer.exe .
.
After adding the alias, you need to reload your .bashrc
file for the changes to take effect:
source ~/.bashrc
Then you can use:
explorer
This makes it easier to switch between your Linux command line and Windows Explorer seamlessly.