Monday 12 February 2018

linux - How can I find the oldest file in a directory tree


I'm looking for a shell one-liner to find the oldest file in a directory tree.



Answer



This works (updated to incorporate Daniel Andersson's suggestion):


find -type f -printf '%T+ %p\n' | sort | head -n 1

No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...