在 CentOS 里并没有一个叫 recycle 的默认系统服务或命令,所以“禁用 recycle”通常取决于你具体指的是哪一个功能。下面把最常见的几种情况都列出来,你可以对号入座。
CentOS 默认 没有启用回收站,但如果你在用 GNOME / KDE 桌面环境,删除文件时可能会进回收站。
设置 → 行为rm -rf 文件名
如果你是在 Samba 文件共享 里看到 recycle,那是 Samba 的回收站模块。
编辑 Samba 配置:
vim /etc/samba/smb.conf
找到类似:
recycle:repository = .recycle
recycle:keeptree = yes
recycle:versions = yes
✅ 删除或注释掉这些行,然后重启 Samba:
systemctl restart smb nmb
请确认:
systemctl list-units | grep -i recycle
ps -ef | grep -i recycle
如果是一个服务:
systemctl disable recycle
systemctl stop recycle
CentOS 默认 没有 recycle 命令,如果你自己装过:
which recycle
rpm -qf $(which recycle)
然后卸载:
yum remove 软件名
比如 tmpwatch / systemd-tmpfiles:
systemctl status systemd-tmpfiles-clean
systemctl disable systemd-tmpfiles-clean.timer
systemctl stop systemd-tmpfiles-clean.timer
请告诉我:
我可以直接给你一条精确命令 ✅