Salut
J'ai commencé à coder un shell pour décrasser Linux le plus possible, mais je suis trèès loin d'être un expert dans ce domaine, alors je me demandais si il y en avait qui seraient partant pour coder avec moi ce script, de la façon la plus propre et optimisée qu'on puisse faire
Pour le moment il se contente de chercher des fichiers inutiles et de les déplacer vers la corbeille
--------------------------------------------------
------
- !/bin/bash
IFS=$'\n'
TRASH=/home/*/.local/share/Trash/files
function clean_home {
mv $(find /home -type f -size 0) $TRASH
mv $(find /home -type f -iname "*.log") $TRASH
}
function clean_root {
mv $(find / -type f -iname "*~") $TRASH
mv $(find / -type f -iname "*.old") $TRASH
mv $(find / -type f -iname "*-old") $TRASH
mv $(find / -type f -iname "*.bak") $TRASH
}
function clean_link {
mv $(find /usr -type l | perl -lne 'print if ! -e') $TRASH
}
clean_home
clean_root
clean_link
exit 0;
--------------------------------------------------
-------