I have a very large number of files to delete, which go by the following format:
esymac_logEvents.log.5_2017-Feb-06_02-39-17.Z_2017-Feb-08_02-39-14.Z_2017-Feb-09_02-39-14.Z_2017-Feb-11_02-39-11.Z_2017-Feb-13_02-39-08.Z_2017-Feb-16_02-39-05.Z_2017-Feb-18_02-39-3.Z_2017-Feb-20_02-39-02.Z_2017-Mar-02_12-06-57
esymac_logEvents.log.6_2017-Feb-07_02-39-15.Z_2017-Feb-08_02-39-14.Z_2017-Feb-09_02-39-14.Z_2017-Feb-16_02-39-05.Z_2017-Feb-18_02-39-03.Z_2017-Feb-19_02-39-03.Z_2017-Feb-20_02-39-2.Z_2017-Feb-21_02-38-55.Z
esymac_logEvents.log.6_2017-Feb-07_02-39-15.Z_2017-Feb-09_02-39-14.Z_2017-Feb-12_02-39-10.Z_2017-Feb-15_02-39-06.Z_2017-Feb-16_02-39-05.Z_2017-Feb-17_02-39-04.Z_2017-Feb-19_02-39-3.Z_2017-Feb-20_02-39-02.Z_2017-Feb-21_02-38-55.Z
esymac_logEvents.log.6_2017-Feb-10_02-39-12.Z_2017-Feb-15_02-39-06.Z_2017-Feb-18_02-39-03.Z_2017-Feb-19_02-39-03.Z_2017-Feb-20_02-39-02.Z_2017-Feb-21_02-38-55.Z
esymac_logEvents.log.5_2017-Feb-06_02-39-17.Z_2017-Feb-07_02-39-15.Z_2017-Feb-10_02-39-12.Z_2017-Feb-19_02-39-03.Z_2017-Feb-22_02-39-05.Z_2017-Feb-23_02-39-09.Z
esymac_logEvents.log.5_2017-Feb-06_02-39-17.Z_2017-Feb-08_02-39-14.Z_2017-Feb-11_02-39-11.Z_2017-Feb-12_02-39-10.Z_2017-Feb-14_02-39-07.Z_2017-Feb-15_02-39-06.Z_2017-Feb-17_02-39-4.Z_2017-Feb-22_02-39-05.Z_2017-Feb-23_02-39-09.Z
esymac_logEvents.log.6_2017-Feb-09_02-39-14.Z_2017-Feb-13_02-39-08.Z_2017-Feb-17_02-39-04.Z_2017-Feb-19_02-39-03.Z_2017-Feb-21_02-38-55.Z
esymac_logEvents.log.6_2017-Feb-07_02-39-15.Z_2017-Feb-08_02-39-14.Z_2017-Feb-11_02-39-11.Z_2017-Feb-12_02-39-10.Z_2017-Feb-14_02-39-07.Z_2017-Feb-15_02-39-06.Z_2017-Feb-17_02-39-04.Z_2017-Feb-22_02-39-05.Z_2017-Feb-23_02-39-09.Z
I want to delete them, but the rm() command gives me the 'Argument list too large' error. Couldn't formulate myself a command after checking similar posts, is there any way I could get a command that would:
- first create argument list with all esymac_logEvents.log.* files,
- remove the files one by one, with a loop or exec command (maybe not
one at atime, it would be preferable to remove the max number of arguments rm() function can receive)
Cheers.