How to find the oldest and newest file in directory in Linux shell 2020-05-04 / By juzhax / Linux, Mac / Directory, find, linux, Oldest Complex way, but allowed you to customise the output. find /home/juzhax/ -type f -printf '%T- %p\n' | sort | head -n 1 Simple and shorter way ls -lt | tail -1 Extra: Find the newest files in shell ls -ltr | tail -1 Tags: DirectoryfindlinuxOldest