Recursively find last modified file in a directory

I need to find the most recent file recursively. Linux find command took around 50 minutes.

Here is a little script to do it faster (less than 2 seconds):

It’s a recursive function who get the most recent modified item of a directory. If this item is a directory, the function is called recursively and search into this directory, etc.

To search last modified file in /var/log, just call the script like this:

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *