Oracle Linux 5.10
BASH shell
[oracle@src01]$ getconf ARG_MAX
131072
[oracle@srv01]$ ls -1 | wc -l
40496
#!/bin/bash
#
# delete files in /imr_report_repo that are older than 15-days
find /imr_report_repo/* -maxdepth 0 -type f -mtime +15 |
while read file
do
rm -f $file
done
/usr/bin/find: Argument list too long
If I'm reading this right the maximum arguments allowed is 131,072 and I only have 40,496 files in this directory. I haven't checked, but I'm probably trying to delete 40,000 files (over 2-weeks old).