效果如图:

编辑脚本:
vim /usr/bin/openpwd
#! /bin/bash
# 如果没有提供参数,则使用当前目录
if [ $# -eq 0 ]; then
target_dir="."
else
target_dir="$1"
fi
# 转换为Windows路径并打开
explorer.exe $(wslpath -w "$target_dir")
赋予权限:
chmod +x /usr/bin/openpwd
效果如图:

编辑脚本:
vim /usr/bin/openpwd
#! /bin/bash
# 如果没有提供参数,则使用当前目录
if [ $# -eq 0 ]; then
target_dir="."
else
target_dir="$1"
fi
# 转换为Windows路径并打开
explorer.exe $(wslpath -w "$target_dir")
赋予权限:
chmod +x /usr/bin/openpwd
4065
5942
1128
1044
692
4134

被折叠的 条评论
为什么被折叠?