在 Ubuntu(以及大多数 Linux 发行版)中,“回收站(Recycle Bin)” 并不是像 Windows 那样有全局统一的 C:\Recycle.Bin,而是每个用户独立存放的。
对于当前用户,回收站默认在:
/home/用户名/.local/share/Trash/
例如用户是 ubuntu,则路径是:
/home/ubuntu/.local/share/Trash/
该目录下通常包含:
files/:被删除的文件本体info/:删除信息(原路径、删除时间等,扩展名为 .trashinfo)示例:
~/.local/share/Trash/files/example.txt
~/.local/share/Trash/info/example.txt.trashinfo
可以直接用:
cd ~/.local/share/Trash
ls
如果是移动硬盘或 U 盘,回收站一般在挂载点的隐藏目录中:
/media/用户名/磁盘名/.Trash-1000/
(1000 通常是用户 UID)
rm)不会进入回收站,而是直接删除如果你是想通过程序 / 脚本访问回收站,或者使用的是 服务器版 Ubuntu(无桌面),可以告诉我具体场景,我可以给你更合适的方案。