I am trying to make a command which will find all the files modified in past 24 hours and which are PHP only with a loop to look into each public_html directories  and save the output into a HTML file so i can view daily. for i in `ls /var/cpanel/users`;  do find /home/$i/public_html -type f -ctime -1 -exec ls -ls {} \; >  /home/demo4/public_html/output.html; done;But it is not working properly and giving output not correct..here is the output which is only for 1 account, it should be for all accounts0 -r-xr-xr-x 1 ziaengg ziaengg 0 Jan 12 15:16 /home/ziaengg/public_html/modules/mod_rsflashmatic/xml/rsflashmatic_93.xml 23320 -rw-r--r-- 1 ziaengg ziaengg 23851008 Jan 12 15:25 /home/ziaengg/public_html/error_logAlso i would like to learn how can i email the result to any specific id..And what parameter should i add if i want to exclude any file containing the keyword cache.I am really new to this.
find files in linux with some exceptions
find
Try:cd /var/cpanel/users &&for i in *do    find /home/$i/public_html -type f ! -iname '*cache*' -ctime -1 -ls done > /home/demo4/public_html/output.htmlNotes:Use >> instead of >, otherwise each iteration overwrites the output of the last. Or redirect the output of the whole loop, in which case you can use >.some find implementations have a -ls option which is quite like -exec ls -ld {} \;, so use it instead where available.Use the ! operator to negate searches: ! -iname '*cache*'if your find doesn't support the non-standard -iname predicate, use -name '*[cC][aA][cC][hH][eE]*' instead.Since these are usernames, you could use for i in $(ls ..), but it is safer to use for i in *.