CentOS 系统本身并没有回收站这一概念,因为它是基于 Linux 的开源操作系统,而回收站是 Windows 系统的特性。在 CentOS 中,删除的文件通常不会移动到“回收站”或“废纸篓”,而是直接从文件系统中移除。因此,CentOS 回收站删除的文件不能通过常规手段找回。
使用extundelete工具恢复ext4文件系统中的文件:
sudo yum install e2fsprogs-devel gcc gcc-cwget http://nchc.dl.sourceforge.net/project/extundelete/extundelete/0.2.4/extundelete-0.2.4.tar.bz2
tar -jxvf extundelete-0.2.4.tar.bz2
cd extundelete-0.2.4
./configure --prefix=/usr/local/extundelete
make && make install
/usr/local/extundelete/bin/extundelete /dev/sdXY --restore-all
/usr/local/extundelete/bin/extundelete /dev/sdXY --restore-directory /path/to/deleted/directory
/usr/local/extundelete/bin/extundelete /dev/sdXY --restore-file /path/to/deleted/file
使用TestDisk工具恢复其他文件系统中的文件:
sudo yum install testdisk
请注意,数据恢复的成功率受多种因素影响,包括数据被删除和覆盖的时间、硬盘的使用情况等。因此,为了避免数据丢失,建议定期备份重要文件。