wes*_*ius 62 windows-subsystem-for-linux
当我在 Windows 资源管理器地址栏中键入“bash”并按 Enter 键时,它会在该目录中打开 shell。我经常发现自己想要在我通过 shell 到达的工作目录中使用 Windows 程序处理文件。有没有一种简单的方法可以从通过 shell 到达的位置打开资源管理器?
Sol*_*sei 85
要在资源管理器中打开当前目录- 使用以下命令(WSL 自行设置 Windows 路径):
explorer.exe .
Run Code Online (Sandbox Code Playgroud)
您可以设置别名使用.bashrc自定义命令:
echo 'alias explorer="explorer.exe ."' >> ~/.bashrc
source ~/.bashrc
Run Code Online (Sandbox Code Playgroud)
现在只需使用:
explorer
Run Code Online (Sandbox Code Playgroud)
在 Windows 资源管理器中打开当前工作目录。
lav*_*rya 23
Microsoftwslpath正是为此目的提供了一个二进制文件。
explorer.exe `wslpath -w "$PWD"`
Run Code Online (Sandbox Code Playgroud)
从恶癖GitHub的问题,要求使用信息,有4个选项- ,,和。-a-u-w-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’
Run Code Online (Sandbox Code Playgroud)
tra*_*nag 17
您可以wslview像这样使用在 CWD 中打开资源管理器实例
wslview .
Run Code Online (Sandbox Code Playgroud)
它是wslutilities的一项功能,默认安装在较新的 Ubuntu WSL 发行版中。它可以安装在几乎所有其他流行的发行版中。
Fra*_*ena 14
对于 WSL2,您可以像这样从 Windows 访问主目录:
\\wsl$
Run Code Online (Sandbox Code Playgroud)
很抱歉在聚会上迟到了!
我创建了一个名为eopen“轻松打开资源管理器”的小工具。
https://github.com/ko1nksm/eopen
Usage: eopen [options] [file | directory | uri]
options:
-e, --editor Open the file in text editor ($EOPEN_EDITOR)
-n, --new Open the specified directory in new instance of explorer
--sudo Use sudo to write the unowned file
-v, --version Display the version
-h, --help You're looking at it
note:
The file or the directory allows linux and windows path.
(e.g. /etc/hosts, C:/Windows/System32/drivers/etc/hosts)
The uri must start with protocol schema. (e.g http:, https:)
Run Code Online (Sandbox Code Playgroud)
这是另一个解决方案。 https://github.com/4U6U57/wsl-open
| 归档时间: |
|
| 查看次数: |
66862 次 |
| 最近记录: |