Hello i want ot delete files older than 1 day i tried all this but nothing is working. Code: find /var/www/html/search/ -mtime +1 -exec rm {} \; find /var/www/html/search -mtime +1 -type f -exec ls -la {} \; /usr/bin/find /var/www/html/search \( -type f -a -mtime +1 \) -exec rm -f {} \; find . -name '*/var/www/html/search*' -atime +1 -delete find /var/www/html/search -mtime +1 find /var/www/html/search/ -type f -mtime +1|xargs ls -l the last one just gives me an output of the root directory.
Try this script: Code: #!/bin/bash for file in "$( find /var/www/html/search/ -type f -mtime +1 )" do rm -f $file done