Find the latest file by modified date
- by Rich
If I want to find the latest file (mtime) in a (big) directory containing subdirectories, how would I do it?
Lots of posts I've found suggest some variation of ls -lt | head (amusingly, many suggest ls -ltr | tail which is the same but less efficient) which is fine unless you have subdirectories (I do).
Then again, you could
find . -type f -exec…