在 Linux 里“回收站(Recycle)”通常有两种常见情况,下面分别说明批量删除方法。
用户级回收站一般在:
~/.local/share/Trash/files
ls -lh ~/.local/share/Trash/files
rm -rf ~/.local/share/Trash/files/*
rm -rf ~/.local/share/Trash/info/*
✅ 推荐用桌面自带命令(更安全):
# GNOME
gio trash --empty
# KDE
kioclient5 move trash:/ . # 不太推荐
例如:
/data/recycle
ls -lh /data/recycle
rm -rf /data/recycle/*
删除 7 天前的文件:
find /data/recycle -type f -mtime +7 -delete
删除 7 天前的目录:
find /data/recycle -type d -mtime +7 -exec rm -rf {} +
路径通常在:
/share/recycle
批量清理示例:
find /share/recycle -type f -mtime +30 -delete
find /path -type f -mtime +7
rm -rf / 这种灾难-print 确认:find /path -type f -mtime +7 -print
如果你能告诉我:
我可以给你精确命令。