本文主要是介绍清除垃圾文件 -- 腳本,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
#!/bin/bash
#----------------------------------------------------------------------
#
#----------------------------------------------------------------------
# 作者:大寶 <michaelbond01@163.com>
# 最後更新日期:2009-10-12 23:21:25
#----------------------------------------------------------------------
# 本腳本遵從 GNU
#----------------------------------------------------------------------
# 編輯說明
# 若想屏蔽某條目,請在該條目段前加上英文“#”號即可
#----------------------------------------------------------------------
# 使用說明
# 請關閉所有應用程序再運行此腳本,否則可能會造成意想不到的損壞
#----------------------------------------------------------------------
# 常規垃圾
find ~/ -name "*~" -exec mv {} ~/.local/share/Trash/files \;
find ~/ -name ".*~" -exec mv {} ~/.local/share/Trash/files \;
find /media -name "*~" -exec mv {} ~/.local/share/Trash/files \;
find /media -name ".*~" -exec mv {} ~/.local/share/Trash/files \;
find ~/ -name "*.bak" -exec mv {} ~/.local/share/Trash/files \;
find ~/ -name "*.BAK" -exec mv {} ~/.local/share/Trash/files \;
find ~/ -name "*.OLD" -exec mv {} ~/.local/share/Trash/files \;
find ~/ -name "*.old" -exec mv {} ~/.local/share/Trash/files \;
find ~/ -name "*.chk" -exec mv {} ~/.local/share/Trash/files \;
find ~/ -name "*.CHK" -exec mv {} ~/.local/share/Trash/files \;
#----------------------------------------------------------------------
# aMule
find ~/.aMule -name "logfile" -exec mv {} ~/.local/share/Trash/files \;
#----------------------------------------------------------------------
# Audacious
## 日志文件
find ~/.config/audacious -name "log" -exec mv {} ~/.local/share/Trash/files \;
## 播放列表
find ~/.config/audacious -name "playlist.xspf" -exec mv {} ~/.local/share/Trash/files \;
#----------------------------------------------------------------------
# VLC 播放列表
find ~/.local/share/vlc -name "*.xspf" -exec mv {} ~/.local/share/Trash/files \;
#----------------------------------------------------------------------
# Bash
find ~/ -name ".bash_history" -exec mv {} ~/.local/share/Trash/files \;
#----------------------------------------------------------------------
# Flash
mv ~/.macromedia/Flash_Player/* ~/.local/share/Trash/files;
#----------------------------------------------------------------------
# gedit
find ~/.cache/gedit -name "gedit-metadata.xml" -exec mv {} ~/.local/share/Trash/files \;
#----------------------------------------------------------------------
# Pidgin
#mv ~/.purple/logs ~/.local/share/Trash/files && mkdir ~/.purple/logs;
#----------------------------------------------------------------------
# Libfetion
find ~/.libfetion -name "libfx.db" -exec mv {} ~/.local/share/Trash/files \;
#----------------------------------------------------------------------
# Wine
#mv ~/.wine/drive_c/windows/temp/* ~/.local/share/Trash/files;
#----------------------------------------------------------------------
# Nero
find ~/.nero -name "*.log" -exec mv {} ~/.local/share/Trash/files \;
#----------------------------------------------------------------------
# 永中Office
mv ~/EIOffice/EIOBackup ~/.local/share/Trash/files;
#----------------------------------------------------------------------
# Google 地球
find ~/.googleearth/Cache -name "dbCache.*" -exec mv {} ~/.local/share/Trash/files \;
mv ~/.googleearth/Temp/* ~/.local/share/Trash/files;
#----------------------------------------------------------------------
# Winff
find ~/.winff -name "*.sh" -exec mv {} ~/.local/share/Trash/files \;
#----------------------------------------------------------------------
# Kchmviewer
find ~/.kchmviewer -name "*.kchmviewer" -exec mv {} ~/.local/share/Trash/files \;
#----------------------------------------------------------------------
# 系統緩存
find ~/.cache -name "*.pb" -exec mv {} ~/.local/share/Trash/files \;
#----------------------------------------------------------------------
# Okular
mv ~/.kde/share/apps/okular/docdata/* ~/.local/share/Trash/files;
#----------------------------------------------------------------------
# 星际译王
mv ~/.stardict/history ~/.local/share/Trash/files;
#----------------------------------------------------------------------
# 缩略图
mv ~/.thumbnails/normal/* ~/.local/share/Trash/files;
mv ~/.thumbnails/fail/gnome-thumbnail-factory/* ~/.local/share/Trash/files;
#----------------------------------------------------------------------
# 緩存的軟件包
gksu apt-get clean && gksu apt-get autoclean;
gksu: 类似win的cmd
这篇关于清除垃圾文件 -- 腳本的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!