find command delete files older than x days

Find command delete specific files older than 7 days in linux
/usr/bin/find /var/www/html/uploads -name "*.pdf" -type f -mtime +7 -exec rm {} \;


Find command delete all file of specific directory older than 7 days
 /usr/bin/find /var/www/html/uploads -type f -mtime +7 -exec rm {} \;

Post a Comment

Mới hơn Cũ hơn