赛博后悔药

18 小时 27 分钟前
 andforce
 unalias rm 2>/dev/null
 function rm {
   local args=()
   for arg in "$@"; do
     case "$arg" in
       -*) ;;  # 跳过所有 flag ,只保留文件路径
       *) args+=("$arg") ;;
     esac
   done
   if [[ ${#args[@]} -eq 0 ]]; then
     echo "rm: missing operand"
     return 1
   fi
   trash "${args[@]}"
 }

放到 Mac 的 ~/.zshrc 中,这样所有删除都会进入回收站

745 次点击
所在节点    程序员
3 条回复
liuxue
14 小时 38 分钟前
如果 ai 不使用你的环境变量,不还是会出问题么
ruanimal
1 小时 52 分钟前
你没有用过 trash-cli 吗? 另外 ai 很喜欢用绝对路径,alias 其实作用也不大
cheng6563
1 小时 10 分钟前
windows ,让 AI 糊了个 sbox.md ,sbox codex 这样启动 codex ,就建一个 sandboxie 区,只给当前目录设置完全访问,其他目录全走 sandboxie

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1238473

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX