So I wanted to know the oldest file on my Debian Linux box.
find / -type f -printf '%T+ %p\n' | sort | head -n 1
Here is an another example for /etc/find /etc/ -type f -printf '%T+ %p\n' | sort | head -n 10
So find command finds all files in / and print it with a special format. The %T+ (in -printf) means file’s last modification date and time in separated by +, for example ‘2004-04-28+22:22:05.0’. This is a GNU extension and may not work on other BSD/find or any other version of find. The %p indicts the file name. The sort command sorted input and passed it to head to display the oldest file on my GNU/Linux system. The sort command sorted input and passed it to head to display the oldest file on my GNU/Linux system. Cool, eh?
(Credit: Ubuntu forums).