How to open windows explorer from current working directory of WSL shell?
When I type "bash" to the windows explorer address bar and hit Enter, it opens the shell in that directory. Often I find myself wanting to work on files with windows programs in the working directory I reached through shell. Is there an easy way to open explorer from the location reached through shell?
windows-subsystem-for-linux
add a comment |
When I type "bash" to the windows explorer address bar and hit Enter, it opens the shell in that directory. Often I find myself wanting to work on files with windows programs in the working directory I reached through shell. Is there an easy way to open explorer from the location reached through shell?
windows-subsystem-for-linux
lets say I navigate in shell to /mnt/c/Users/adam/Dropbox/folder and I want to work in that directory, I would like to open explorer at that exact location
– wesalius
Jul 13 '18 at 21:24
add a comment |
When I type "bash" to the windows explorer address bar and hit Enter, it opens the shell in that directory. Often I find myself wanting to work on files with windows programs in the working directory I reached through shell. Is there an easy way to open explorer from the location reached through shell?
windows-subsystem-for-linux
When I type "bash" to the windows explorer address bar and hit Enter, it opens the shell in that directory. Often I find myself wanting to work on files with windows programs in the working directory I reached through shell. Is there an easy way to open explorer from the location reached through shell?
windows-subsystem-for-linux
windows-subsystem-for-linux
asked Jul 13 '18 at 17:58
wesalius
208
208
lets say I navigate in shell to /mnt/c/Users/adam/Dropbox/folder and I want to work in that directory, I would like to open explorer at that exact location
– wesalius
Jul 13 '18 at 21:24
add a comment |
lets say I navigate in shell to /mnt/c/Users/adam/Dropbox/folder and I want to work in that directory, I would like to open explorer at that exact location
– wesalius
Jul 13 '18 at 21:24
lets say I navigate in shell to /mnt/c/Users/adam/Dropbox/folder and I want to work in that directory, I would like to open explorer at that exact location
– wesalius
Jul 13 '18 at 21:24
lets say I navigate in shell to /mnt/c/Users/adam/Dropbox/folder and I want to work in that directory, I would like to open explorer at that exact location
– wesalius
Jul 13 '18 at 21:24
add a comment |
3 Answers
3
active
oldest
votes
To open the current directory in Explorer - use the following (WSL sets the Windows path by itself):
explorer.exe .
You can set alias with .bashrc
for a custom command:
echo 'alias explorer="explorer.exe ."' >> ~/.bashrc
source ~/.bashrc
Now just use:
explorer
to open the current working directory in Windows Explorer.
add a comment |
Microsoft provides a binary wslpath
for exactly this purpose.
explorer.exe `wslpath -w "$PWD"`
Cribbing from the github issue asking for usage info, there are 4 options - -a
, -u
, -w
and -m
.
wslpath usage:
-a force result to absolute path format
-u translate from a Windows path to a WSL path (default)
-w translate from a WSL path to a Windows path
-m translate from a WSL path to a Windows path, with ‘/’ instead of ‘\’
EX: wslpath ‘c:users’
add a comment |
From a WSL shell prompt, run
explorer.exe "Windows path"
such as
explorer.exe L:
If L: maps to your desired directory (any unused drive letter may be used for this). You can map to network drives within Explorer, or to a local folder with SUBST.
Problem is, your /home/USERNAME/ folder in WSL appears to Windows something like C:UsersYOURUSERNAMEAppDataLocalPackagesCanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgscLocalStaterootfshometester . You could use SUBST to turn this into a drive letter a la
SUBST L: C:UsersYOURUSERNAMEAppDataLocalPackagesCanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgscLocalStaterootfshometester
then use a relative path from L: for your destination.
Let's say you have a WSL folder /home/YOURUSERNAME/acme/novelties
. You could get close to there with explorer.exe L:
but explorer.exe L:acme
or explorer.exe acmenovelties
will not bring you to where you wish to be, and instead will bring you to your Windows user Documents folder, instead.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1338991%2fhow-to-open-windows-explorer-from-current-working-directory-of-wsl-shell%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
To open the current directory in Explorer - use the following (WSL sets the Windows path by itself):
explorer.exe .
You can set alias with .bashrc
for a custom command:
echo 'alias explorer="explorer.exe ."' >> ~/.bashrc
source ~/.bashrc
Now just use:
explorer
to open the current working directory in Windows Explorer.
add a comment |
To open the current directory in Explorer - use the following (WSL sets the Windows path by itself):
explorer.exe .
You can set alias with .bashrc
for a custom command:
echo 'alias explorer="explorer.exe ."' >> ~/.bashrc
source ~/.bashrc
Now just use:
explorer
to open the current working directory in Windows Explorer.
add a comment |
To open the current directory in Explorer - use the following (WSL sets the Windows path by itself):
explorer.exe .
You can set alias with .bashrc
for a custom command:
echo 'alias explorer="explorer.exe ."' >> ~/.bashrc
source ~/.bashrc
Now just use:
explorer
to open the current working directory in Windows Explorer.
To open the current directory in Explorer - use the following (WSL sets the Windows path by itself):
explorer.exe .
You can set alias with .bashrc
for a custom command:
echo 'alias explorer="explorer.exe ."' >> ~/.bashrc
source ~/.bashrc
Now just use:
explorer
to open the current working directory in Windows Explorer.
edited Dec 18 '18 at 11:21
Glorfindel
1,35041220
1,35041220
answered Dec 18 '18 at 9:15
Sole Sensei
261
261
add a comment |
add a comment |
Microsoft provides a binary wslpath
for exactly this purpose.
explorer.exe `wslpath -w "$PWD"`
Cribbing from the github issue asking for usage info, there are 4 options - -a
, -u
, -w
and -m
.
wslpath usage:
-a force result to absolute path format
-u translate from a Windows path to a WSL path (default)
-w translate from a WSL path to a Windows path
-m translate from a WSL path to a Windows path, with ‘/’ instead of ‘\’
EX: wslpath ‘c:users’
add a comment |
Microsoft provides a binary wslpath
for exactly this purpose.
explorer.exe `wslpath -w "$PWD"`
Cribbing from the github issue asking for usage info, there are 4 options - -a
, -u
, -w
and -m
.
wslpath usage:
-a force result to absolute path format
-u translate from a Windows path to a WSL path (default)
-w translate from a WSL path to a Windows path
-m translate from a WSL path to a Windows path, with ‘/’ instead of ‘\’
EX: wslpath ‘c:users’
add a comment |
Microsoft provides a binary wslpath
for exactly this purpose.
explorer.exe `wslpath -w "$PWD"`
Cribbing from the github issue asking for usage info, there are 4 options - -a
, -u
, -w
and -m
.
wslpath usage:
-a force result to absolute path format
-u translate from a Windows path to a WSL path (default)
-w translate from a WSL path to a Windows path
-m translate from a WSL path to a Windows path, with ‘/’ instead of ‘\’
EX: wslpath ‘c:users’
Microsoft provides a binary wslpath
for exactly this purpose.
explorer.exe `wslpath -w "$PWD"`
Cribbing from the github issue asking for usage info, there are 4 options - -a
, -u
, -w
and -m
.
wslpath usage:
-a force result to absolute path format
-u translate from a Windows path to a WSL path (default)
-w translate from a WSL path to a Windows path
-m translate from a WSL path to a Windows path, with ‘/’ instead of ‘\’
EX: wslpath ‘c:users’
edited Jul 27 '18 at 5:48
answered Jul 26 '18 at 23:24
laverya
539
539
add a comment |
add a comment |
From a WSL shell prompt, run
explorer.exe "Windows path"
such as
explorer.exe L:
If L: maps to your desired directory (any unused drive letter may be used for this). You can map to network drives within Explorer, or to a local folder with SUBST.
Problem is, your /home/USERNAME/ folder in WSL appears to Windows something like C:UsersYOURUSERNAMEAppDataLocalPackagesCanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgscLocalStaterootfshometester . You could use SUBST to turn this into a drive letter a la
SUBST L: C:UsersYOURUSERNAMEAppDataLocalPackagesCanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgscLocalStaterootfshometester
then use a relative path from L: for your destination.
Let's say you have a WSL folder /home/YOURUSERNAME/acme/novelties
. You could get close to there with explorer.exe L:
but explorer.exe L:acme
or explorer.exe acmenovelties
will not bring you to where you wish to be, and instead will bring you to your Windows user Documents folder, instead.
add a comment |
From a WSL shell prompt, run
explorer.exe "Windows path"
such as
explorer.exe L:
If L: maps to your desired directory (any unused drive letter may be used for this). You can map to network drives within Explorer, or to a local folder with SUBST.
Problem is, your /home/USERNAME/ folder in WSL appears to Windows something like C:UsersYOURUSERNAMEAppDataLocalPackagesCanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgscLocalStaterootfshometester . You could use SUBST to turn this into a drive letter a la
SUBST L: C:UsersYOURUSERNAMEAppDataLocalPackagesCanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgscLocalStaterootfshometester
then use a relative path from L: for your destination.
Let's say you have a WSL folder /home/YOURUSERNAME/acme/novelties
. You could get close to there with explorer.exe L:
but explorer.exe L:acme
or explorer.exe acmenovelties
will not bring you to where you wish to be, and instead will bring you to your Windows user Documents folder, instead.
add a comment |
From a WSL shell prompt, run
explorer.exe "Windows path"
such as
explorer.exe L:
If L: maps to your desired directory (any unused drive letter may be used for this). You can map to network drives within Explorer, or to a local folder with SUBST.
Problem is, your /home/USERNAME/ folder in WSL appears to Windows something like C:UsersYOURUSERNAMEAppDataLocalPackagesCanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgscLocalStaterootfshometester . You could use SUBST to turn this into a drive letter a la
SUBST L: C:UsersYOURUSERNAMEAppDataLocalPackagesCanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgscLocalStaterootfshometester
then use a relative path from L: for your destination.
Let's say you have a WSL folder /home/YOURUSERNAME/acme/novelties
. You could get close to there with explorer.exe L:
but explorer.exe L:acme
or explorer.exe acmenovelties
will not bring you to where you wish to be, and instead will bring you to your Windows user Documents folder, instead.
From a WSL shell prompt, run
explorer.exe "Windows path"
such as
explorer.exe L:
If L: maps to your desired directory (any unused drive letter may be used for this). You can map to network drives within Explorer, or to a local folder with SUBST.
Problem is, your /home/USERNAME/ folder in WSL appears to Windows something like C:UsersYOURUSERNAMEAppDataLocalPackagesCanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgscLocalStaterootfshometester . You could use SUBST to turn this into a drive letter a la
SUBST L: C:UsersYOURUSERNAMEAppDataLocalPackagesCanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgscLocalStaterootfshometester
then use a relative path from L: for your destination.
Let's say you have a WSL folder /home/YOURUSERNAME/acme/novelties
. You could get close to there with explorer.exe L:
but explorer.exe L:acme
or explorer.exe acmenovelties
will not bring you to where you wish to be, and instead will bring you to your Windows user Documents folder, instead.
answered Jul 13 '18 at 18:42
K7AAY
3,65621438
3,65621438
add a comment |
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1338991%2fhow-to-open-windows-explorer-from-current-working-directory-of-wsl-shell%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
lets say I navigate in shell to /mnt/c/Users/adam/Dropbox/folder and I want to work in that directory, I would like to open explorer at that exact location
– wesalius
Jul 13 '18 at 21:24