效果如图:
编辑脚本:
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