在CentOS系统中,有几个常用的回收工具和命令,可以帮助你管理文件和释放磁盘空间。以下是一些推荐的工具及其使用方法:
sudo yum install trash-cli
trash /path/to/file
trash -r /path/to/directory
trash-empty
sudo yum install extundelete
sudo extundelete /dev/sda1 --restore-file path/to/deleted/file
/etc/logrotate.conf
或创建新的配置文件,例如 /etc/logrotate.d/myapp
,然后运行 logrotate -f /etc/logrotate.conf
测试配置。sudo yum install ncdu
ncdu /path/to/directory
ncdu -r /path/to/directory
crontab -e
设置定时任务。/etc/anacrontab
文件设置定时任务。这些工具各有其独特的功能和适用场景,你可以根据自己的需求选择合适的工具来进行文件回收和磁盘清理。