File’s data was last modified n*24 hours ago.
ls -R /var/log | grep Mar
However it really depends on what your logrotate configuration is set for. You may not be saving that far back.
ls -la /etc/logrotate.d
will give you what is set up to rotate and the config files will tell you how large or how often.
There are several things to take into account when you say all log files from the previous month. You need to look at how the various log applications are storing your log files. Are they rotating the files at then end of the month or when the log gets to a certain size or at the end of the day.
For example if today is Aug 8th and your httpd log is set up to rotate when the size of the file exceeds 1MB and the access.log.1 log has entries from Jul 24th through Aug 2nd. it has a last access date of Aug 2nd but contains entries from the previous month. Does it show up in your list of last months logs or not? That is why I originally mentioned /etc/logrotate.d/ so you could go review the scripts doing the log rotations.
The other thing you have to consider is that different logs store data in different formats so how do you scan the different logs for the month in question?
Determining the previous month is really not a problem. You can quickly find the previous month by using the date command and subtracting 1.
will give you the current month in numerical format