How do I find all files in a folder(including subfolders) with extension jpg or bmp, with size between 6 and 46 kilobytes, last modified between 11 and 19 June 2011 or between 24 July and 2 August inclusively and add all these files to an archive(bzip2)?
You can try a similar command (but it actually has a flaw):
Not sure about the dates, though. It works for me as
There is a major conceptual mistake in the previous example.
It may not be noticed with a few dozen test files, but a few hundred will trigger the bug for sure. So the command needs to be rewritten as follows:
The main difference is the absence of
Another possible bug to point out is the date range specification. The upper end of date range should be increased by 1 day (otherwise files modified on that day will be omitted).