I have a folder that has a lot of files (various logs generated by a website).
Managed to count them with:
$ find . -maxdepth 1|wc -l
803313
Now I need to check the logs in the past few days. Getting the last 100 / 1000 / ... files is just as good. The problem is the above command took about 5 seconds. So, at almost 1 million files, my regular ls -lrt|tail -n 100
isn't an option.
So, any ideas on how to efficiently get the last modified files ?
PS: Using Ubuntu 12.04 LTS