1 Star 7 Fork 4

yhan219/navicat_reset_mac

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
delete_navicat.sh 825 Bytes
一键复制 编辑 原始数据 按行查看 历史
yhan219 提交于 2025-03-02 20:41 +08:00 . feat: 添加卸载脚本
#!/bin/bash
# 定义要查找的目录
directories=("/private" "$HOME")
# 遍历目录
for dir in "${directories[@]}"; do
echo "正在查找目录: $dir"
# 使用 find 命令查找文件
# -type f: 只查找文件
# -iname "*navicat*": 文件名包含 "navicat"(不区分大小写)
# ! -name "*.ncx": 排除 .ncx 结尾的文件
# ! -name "*.sh": 排除 .sh 结尾的文件
# ! -path "*reset*": 排除路径中包含 "reset" 的文件或文件夹
# -print0: 以 null 字符分隔结果,避免文件名中的空格问题
find "$dir" -type f -iname "*navicat*" ! -name "*.ncx" ! -name "*.sh" ! -path "*reset*" -print0 | while IFS= read -r -d '' file; do
echo "删除文件: $file"
rm -f "$file"
done
echo "查找完成: $dir"
done
echo "所有操作完成"
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yhan219/navicat_reset_mac.git
git@gitee.com:yhan219/navicat_reset_mac.git
yhan219
navicat_reset_mac
navicat_reset_mac
main

搜索帮助