Find the top 10 oldest file in a directory tree on GNU/Linux

Find the top 10 oldest file in a directory tree on GNU/Linux

Find the top 10 oldest file in a directory tree on GNU/Linux

To list top 10 the oldest file in /etc/ directory:
find /etc/ -type f -printf '%T+ %p\n' | sort | head -n 10
To list top 10 the oldest file in $HOME directory:
find $HOME -type f -printf '%T+ %p\n' | sort | head -n 10
To list top 10 the oldest file in / directory:
find / -type f -printf '%T+ %p\n' | sort | head -n 10

Examples and usage: Find the oldest file in Unix or Linux file system

Leave a Comment