Le 11/04/2021 17:36, Bernard Schoenacker a écrit :
Sorry, why do not consult the web and the rtfm ?
the answer are disponible on this website :
https://www.2daygeek.com/bash-script-to-delete-files-folders-older-than-x-days-in-linux/
https://stackoverflow.com/questions/13489398/delete-files-older-than-10-days-using-shell-script-in-unix#13489511
Okay... Le secret c'est "-mtime +7" dans la commande find:
find ./ -type f -mtime +7
Donc pour effacer, en tenant compte des fichiers qui ont des espaces
dans le nom... ça donne ça:
find ./ -type f -mtime +7 -print0 | xargs -0 -l rm
JM
--