Code:
for file in `ls -ltr --time-style=+%s | awk '{now=systime(); del_time=now-2; if($6<del_time && $5=="0") print $7}'` ;do
chmod 777 $file >/dev/null 2>&1
rm -f $file >/dev/null 2>&1
done
Thread profile page for "rm files older then 2 seconds?" on http://www.unix.com.
This report page is a snippet summary view from a single thread "rm files older then 2 seconds?", located on the Message Board at http://www.unix.com.
This thread profile page shows the thread statistics for: Total Authors, Total Thread Posts, and Thread Activity
| |||||||||||||||||||||||